Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in

Get started

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

Theoretical Computer Science

464 missions · 238 completed

The mathematical foundations of computation: which problems can be solved, by what algorithms, and at what cost in time, space, or communication. Distinguished by its emphasis on rigor and unconditional lower bounds, it spans computational complexity, algorithm design, automata and computability, cryptography, and the analysis of Boolean functions.

Missions

Open226Completed238All464
🏆Completed
Machine LearningStatistics·Captain: wurtle

Memory and precision in noiseless Gaussian regressionResearch Paper

Motivation

A single exact linear equation y=⟨x,s⟩y = \langle x, s\rangley=⟨x,s⟩ about an unknown unit vector s∈Rds \in \mathbb{R}^ds∈Rd carries arbitrarily fine information: ddd independent Gaussian equations determine sss almost surely, provided all of them can be kept. A learner that reads the equations once, in order, and keeps only a bounded number of bits between them faces a different problem. The question asked here is how many noiseless measurements such a learner needs in order to reach a prescribed angular precision ϵ\epsilonϵ, as a function of its memory.

This is a question about memory–sample trade-offs: how much a bound on persistent memory forces a learning procedure to read more data. With unbounded real registers, the randomized Kaczmarz update zt=zt−1+yt−⟨xt,zt−1⟩∥xt∥2xtz_t = z_{t-1} + \frac{y_t - \langle x_t, z_{t-1}\rangle}{\|x_t\|^2} x_tzt​=zt−1​+∥xt​∥2yt​−⟨xt​,zt−1​⟩​xt​ satisfies E∥zt−s∥2=(1−1/d)t\mathbb{E}\|z_t - s\|^2 = (1 - 1/d)^tE∥zt​−s∥2=(1−1/d)t on isotropic Gaussian rows, so order dlog⁡(1/ϵ)d\log(1/\epsilon)dlog(1/ϵ) samples suffice. That update stores real numbers and gives no finite-bit upper bound; the question is whether a learner with roughly d2d^2d2 bits can do better than this scale.

Background

  • 1937. Kaczmarz introduces the projection method for linear systems; Strohmer and Vershynin (2009) give the randomized version with exponential convergence.
  • 2014. Shamir's finite-message framework for online and distributed learning includes bounded-memory online processing as a special case.
  • 2015. Steinhardt and Duchi prove memory-dependent minimax rates for sparse linear regression with noise.
  • 2016. Steinhardt, Valiant and Wager relate memory, communication and statistical queries and pose a quadratic-memory versus exponential-sample conjecture for parity learning; Raz proves a time–space lower bound for parity learning, and in 2017 extends the method to a large class of learning problems.
  • 2019. Sharan, Sidford and Valiant prove that for Gaussian regression with tiny uniform additive noise, a learner with at most d2/4d^2/4d2/4 bits needs Ω(dlog⁡r)\Omega(d\log r)Ω(dlogr) samples to reach Euclidean accuracy d−rd^{-r}d−r, in a stated range of rrr, and ask (Section 1.1) whether the first-order sample dependence on precision is optimal under bounded memory. In the same year Dagan, Kur and Shamir prove quadratic-space lower bounds for two different linear-prediction tasks in the streaming model.
  • 2026. The OpenAI preprint Memory and precision in noiseless Gaussian regression (dated September 27, 2026) states an ΩA(dlog⁡(1/ϵ))\Omega_A(d\log(1/\epsilon))ΩA​(dlog(1/ϵ)) lower bound for exact observations and memory Ad2Ad^2Ad2. It has not been peer reviewed, and the Lean statement of its main theorem is open on this platform.

Setting

Fix integers d≥2d \ge 2d≥2, M≥0M \ge 0M≥0, T≥0T \ge 0T≥0. A signal sss lies on the unit sphere Sd−1⊂RdS^{d-1} \subset \mathbb{R}^dSd−1⊂Rd. At step t∈{1,…,T}t \in \{1,\dots,T\}t∈{1,…,T} the learner receives the pair (xt,yt)(x_t, y_t)(xt​,yt​) with xt∼N(0,Id)x_t \sim N(0, I_d)xt​∼N(0,Id​) independent and yt=⟨xt,s⟩y_t = \langle x_t, s\rangleyt​=⟨xt​,s⟩ exactly (no noise).

A finite-state learner with MMM bits keeps a state in a set of at most 2M2^M2M elements. A data-independent shared seed ω\omegaω (drawn from a probability space (Ω,ρ)(\Omega,\rho)(Ω,ρ)) may select its rules. Given the seed, the current state, the step index and the current pair, a transition chooses the next state and whether to stop; it may perform unrestricted computation but retains only the next state. The learner must stop by the deterministic horizon TTT. Its output s^∈Sd−1\hat s \in S^{d-1}s^∈Sd−1 is a function of the terminal state, the stopping index and the seed only; a discarded observation cannot be read again. Success at precision ϵ\epsilonϵ means angular error arccos⁡⟨s^,s⟩≤ϵ\arccos\langle \hat s, s\rangle \le \epsilonarccos⟨s^,s⟩≤ϵ.

Write σd\sigma_dσd​ for the uniform probability measure on Sd−1S^{d-1}Sd−1. Uniform success is the probability of success when S∼σdS \sim \sigma_dS∼σd​ is drawn independently of the rows and the seed.

In Lean (OAI.NoiselessRegression), the state space is Fin (2 ^ M), a learner is a structure Learner d M T Ω with fields initialChoice, transition, output, the sample law is the product of stdGaussian on EuclideanSpace ℝ (Fin d), and uniformSuccess and success are the probabilities defined above. Randomness during the run is represented through the arbitrary seed space Ω\OmegaΩ.

Formalization targets

Goal: OAI.NoiselessRegression.main

The goal is the conjunction of two statements.

Fixed quadratic memory (Theorem 1.2): for every A>0A > 0A>0 there are cA>0c_A > 0cA​>0 and dAd_AdA​ such that, for d≥dAd \ge d_Ad≥dA​, M≤Ad2M \le A d^2M≤Ad2, 0<ϵ≤1/100 < \epsilon \le 1/100<ϵ≤1/10, and every admissible learner,

Pr⁡S∼σd{arccos⁡⟨s^,S⟩≤ϵ}≥23  ⟹  T≥cA dlog⁡(1/ϵ).\Pr_{S\sim\sigma_d}\big\{\arccos\langle \hat s, S\rangle \le \epsilon\big\} \ge \tfrac23 \;\Longrightarrow\; T \ge c_A\, d \log(1/\epsilon).S∼σd​Pr​{arccos⟨s^,S⟩≤ϵ}≥32​⟹T≥cA​dlog(1/ϵ).

Subquadratic memory (Corollaries 1.3 and 1.4): there is an absolute c>0c > 0c>0 such that for every memory sequence M(d)=o(d2)M(d) = o(d^2)M(d)=o(d2) there is d0d_0d0​ with the same conclusion T≥c dlog⁡(1/ϵ)T \ge c\, d\log(1/\epsilon)T≥cdlog(1/ϵ) for d≥d0d \ge d_0d≥d0​, under either uniform success at least 2/32/32/3 or success at least 2/32/32/3 for every fixed signal sss.

No relation between ϵ\epsilonϵ and MMM is assumed; the constant is absolute in the subquadratic case.

Milestone: supporting estimates (OAI.MemoryPrecision.main)

A single bundled statement collecting the paper's projection-density and backward-block estimates (Theorem 3.1, Propositions A.1, A.4, A.5, B.6, B.7, Corollary 8.2), the cube-prior precision bound (Proposition 8.3), and the explicit success bound after a bounded number of samples (Proposition 5.3):

Pr⁡{arccos⁡⟨s^,S⟩≤ϵ}≤min⁡{1,[2ϵ eC(1+M/d2)⌈T/q⌉](d−1)/2},q=⌊(d−1)/8⌋.\Pr\{\arccos\langle \hat s, S\rangle \le \epsilon\} \le \min\Big\{1, \Big[2\epsilon\, e^{C(1+M/d^2)\lceil T/q\rceil}\Big]^{(d-1)/2}\Big\},\qquad q = \lfloor (d-1)/8 \rfloor.Pr{arccos⟨s^,S⟩≤ϵ}≤min{1,[2ϵeC(1+M/d2)⌈T/q⌉](d−1)/2},q=⌊(d−1)/8⌋.

Significance

The result. Theorem 1.2 answers, for exact observations and isotropic Gaussian rows, the precision question raised in Section 1.1 of Sharan–Sidford–Valiant: with O(d2)O(d^2)O(d2) bits, the dlog⁡(1/ϵ)d\log(1/\epsilon)dlog(1/ϵ) scale achieved by real-valued Kaczmarz cannot be improved, uniformly over all 0<ϵ≤1/100<\epsilon\le 1/100<ϵ≤1/10. Because an exact-observation learner can simulate added noise, the preprint derives from it an ΩA(drlog⁡d)\Omega_A(d r \log d)ΩA​(drlogd) lower bound in the noisy experiment of Sharan–Sidford–Valiant at accuracy d−rd^{-r}d−r, which strengthens their Ω(dlog⁡r)\Omega(d\log r)Ω(dlogr) bound in that range.

Formalizing it. The result is proved only in an unrefereed preprint; no machine-checked proof exists. A formal proof would certify a lower bound whose model (randomized measurable rules, early stopping, shared seeds, measurability conventions) is delicate, and the conventions are already fixed in the Lean definitions. Remaining work: the full formal proof, and as a variant the every-signal version of Theorem 1.2 for fixed AAA (Corollary 1.4), which the Lean goal states only in the subquadratic case.

Difficulty

Conditioning the uniform prior on one exact observation confines the signal to a hyperplane section of the sphere, a law singular with respect to the original spherical measure; information-theoretic arguments that track a posterior density therefore break down after a single step. Arguments for noisy observations, such as Sharan–Sidford–Valiant's, rely on the noise to keep posteriors spread out and do not transfer to the more informative exact experiment. The bound must also hold uniformly in ϵ\epsilonϵ with no relation between ϵ\epsilonϵ and MMM, so a learner with Θ(d2)\Theta(d^2)Θ(d2) bits must be prevented from storing log⁡(1/ϵ)\log(1/\epsilon)log(1/ϵ) bits per coordinate for very small ϵ\epsilonϵ.

Formalization scope

  • Vectors live in EuclideanSpace ℝ (Fin d); signals and outputs in Metric.sphere 0 1. The uniform sphere law is the normalized toSphere measure; rows are i.i.d. stdGaussian.
  • States are Fin (2 ^ M); the first component of each action is the stop flag. Runs that never stop are forced to terminate at index TTT.
  • Learner.Admissible requires a.e.-measurability of the initial choice, transitions (against Gaussian × Lebesgue on pairs), outputs, and of the full experiment under each fixed signal and under the uniform prior.
  • Probabilities are ℝ≥0∞-valued; the threshold is 2/32/32/3; angular error is Real.arccos ⟪ŝ, s⟫; log⁡\loglog is natural.
  • The seed space Ω\OmegaΩ is an arbitrary probability space in universe u, so randomized learners are covered by placing their randomness in the seed.

The goal cannot be satisfied trivially: the hypotheses range over all admissible learners, and the success threshold 2/32/32/3 is achievable (with large TTT), so the implication has content.

A complete development needs Gaussian measures on Euclidean space, spherical measure and cap estimates, Gram determinants and affine distances, LqL^qLq densities of Gaussian projections, and measurable selection of Borel versions of kernels. The projection-density estimates are reusable beyond this mission. Contributions toward the bundled milestone, or toward any of its component estimates, are welcome.

Selected references

  • OpenAI, Memory and precision in noiseless Gaussian regression, OpenAI Math Release preprint, September 27, 2026. https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Memory-and-precision-in-noiseless-Gaussian-regression-September-27-2026/paper.pdf
  • V. Sharan, A. Sidford, G. Valiant, Memory-Sample Tradeoffs for Linear Regression with Small Error, STOC 2019. https://doi.org/10.1145/3313276.3316403 (full version https://arxiv.org/abs/1904.08544)
  • R. Raz, Fast Learning Requires Good Memory: A Time-Space Lower Bound for Parity Learning, 2016. https://arxiv.org/abs/1602.05161
  • R. Raz, A Time-Space Lower Bound for a Large Class of Learning Problems, FOCS 2017. https://doi.org/10.1109/FOCS.2017.73
  • J. Steinhardt, G. Valiant, S. Wager, Memory, Communication, and Statistical Queries, COLT 2016. https://proceedings.mlr.press/v49/steinhardt16.html
  • J. Steinhardt, J. Duchi, Minimax Rates for Memory-Bounded Sparse Linear Regression, COLT 2015. https://proceedings.mlr.press/v40/Steinhardt15.html
  • O. Shamir, Fundamental Limits of Online and Distributed Algorithms for Statistical Learning and Estimation, NeurIPS 2014. https://proceedings.neurips.cc/paper_files/paper/2014/hash/cc427d934a7f6c0663e5923f49eba531-Abstract.html
  • Y. Dagan, G. Kur, O. Shamir, Space Lower Bounds for Linear Prediction in the Streaming Model, COLT 2019. https://proceedings.mlr.press/v99/dagan19b.html
  • T. Strohmer, R. Vershynin, A Randomized Kaczmarz Algorithm with Exponential Convergence, J. Fourier Anal. Appl. 15 (2009). https://doi.org/10.1007/s00041-008-9030-4
18 thms2 active usersReviewed
🏆Completed
Complexity TheoryGraph Theory·Captain: wurtle

Parity lifts and bounded-treewidth witnesses for Weisfeiler–Leman equivalenceResearch Paper

Motivation

The Weisfeiler–Leman (WL) method is the standard combinatorial heuristic for graph isomorphism: it repeatedly refines colors of kkk-tuples of vertices, and two graphs it cannot tell apart are called kkk-WL equivalent. It is equivalent to counting-logic indistinguishability and, by results of Dvořák (2010) and Dell, Grohe and Rattan (2018), to equality of homomorphism counts from graphs of treewidth below kkk (bags of size at most k+1k+1k+1). For fixed kkk, direct refinement decides kkk-WL equivalence in nO(k)n^{O(k)}nO(k) time; whether the growing exponent is necessary is a natural complexity question.

This preprint gives an exact reduction from a simple constraint problem (choosing compatible elements from finite domains) to kkk-WL equivalence of two explicit uncolored graphs, and uses it to derive nΩ(k)n^{\Omega(k)}nΩ(k) conditional time lower bounds.

Background

  • 1968. Weisfeiler and Leman introduce the refinement method for graph canonization.
  • 1992. Cai, Fürer and Immerman construct parity (CFI) graph pairs of bounded degree that need WL dimension linear in their order.
  • 1999. Grohe shows equivalence in finite-variable logics is complete for polynomial time.
  • 2001. Impagliazzo and Paturi formulate the Exponential Time Hypothesis; Impagliazzo, Paturi and Zane give sparsification.
  • 2010, 2018. Dvořák, and Dell–Grohe–Rattan, characterize kkk-WL equivalence by homomorphism counts from bounded-treewidth graphs.
  • 2019. Atserias, Mančinska, Roberson, Šámal, Severini and Varvitsiotis encode solutions of binary linear systems as graph vertices.
  • 2025. Grohe, Lichter, Neuen and Schweitzer prove Ω(nk/2)\Omega(n^{k/2})Ω(nk/2) round lower bounds for joint refinement; Lichter, Raßmann and Schweitzer conjecture that WL equivalence and identification do not admit no(k)n^{o(k)}no(k) time.
  • 2026. The OpenAI preprint Parity lifts and bounded-treewidth witnesses for Weisfeiler–Leman equivalence (dated September 25, 2026) proves the parity reduction below. It has not been peer reviewed; the Lean goal is open on this platform.

Setting

Fix k≥4k \ge 4k≥4. The atomic type of a tuple x∈V(X)k\mathbf{x} \in V(X)^kx∈V(X)k records all equalities and adjacencies among its entries. In joint refinement a round records the old color of x\mathbf xx and the multiset over y∈V(X)y \in V(X)y∈V(X) of the vectors (Cr(x[1←y]),…,Cr(x[k←y]))(C_r(\mathbf x[1\leftarrow y]), \dots, C_r(\mathbf x[k\leftarrow y]))(Cr​(x[1←y]),…,Cr​(x[k←y])). In separate refinement it records the old color and the kkk multisets { ⁣{Cr(x[i←y]):y} ⁣}\{\!\{C_r(\mathbf x[i\leftarrow y]) : y\}\!\}{{Cr​(x[i←y]):y}}. Two graphs are kkk-WL equivalent (≡k\equiv_k≡k​) when their tuple-color histograms agree at every round. The bag parameter is t=k+1t = k+1t=k+1 (joint) or t=kt = kt=k (separate).

A choice system on ttt domains consists of finite sets D1,…,DtD_1, \dots, D_tD1​,…,Dt​ and, for each pair i<ji < ji<j, a finite label set LijL_{ij}Lij​ with maps λiji:Di→Lij\lambda^i_{ij} : D_i \to L_{ij}λiji​:Di​→Lij​, λijj:Dj→Lij\lambda^j_{ij} : D_j \to L_{ij}λijj​:Dj​→Lij​. A successful choice is (d1,…,dt)∈∏iDi(d_1, \dots, d_t) \in \prod_i D_i(d1​,…,dt​)∈∏i​Di​ with λiji(di)=λijj(dj)\lambda^i_{ij}(d_i) = \lambda^j_{ij}(d_j)λiji​(di​)=λijj​(dj​) for all i<ji < ji<j. Empty domains are allowed.

In Lean (OAI.ParityWL), ChoiceSystem t packages the domains and labels, template t is the ttt-clique with helpers, baseGraph C replaces template types by domains and labels, and zeroLift C, starLift C are the two parity lifts. Colors are defined by recursion on rounds (jointColor, separateColor) with histograms compared as multisets.

Formalization targets

Goal: Theorem 1.2 (Parity reduction)

For k≥4k \ge 4k≥4, either convention and the corresponding ttt, for every choice system on ttt domains the two explicit uncolored simple graphs X0,X⋆X_0, X_\starX0​,X⋆​ have equal order and

X0≡kX⋆  ⟺  the choice system has no successful choice,X_0 \equiv_k X_\star \iff \text{the choice system has no successful choice},X0​≡k​X⋆​⟺the choice system has no successful choice,

both with common color names on separate graphs and with pure-tuple comparison in the disjoint union. If every domain and label set has size at most A≥1A \ge 1A≥1, the common order is at most AMtA M_tAMt​ with

Mt=t 2 t−2+3(t−12)+12(t3).M_t = t\, 2^{\,t-2+3\binom{t-1}{2}} + 12\binom{t}{3}.Mt​=t2t−2+3(2t−1​)+12(3t​).

When a successful choice exists, the histograms already differ after two joint rounds or one separate round.

Significance

The result. The reduction turns compatible-choice problems, which encode sparse satisfiability, into WL equivalence of uncolored graphs whose size grows only linearly in the domain size. Combined with sparsification it gives Theorem 1.3: under the positive-rate ETH there are c>0c > 0c>0, K≥4K \ge 4K≥4 such that no deterministic algorithm decides kkk-WL equivalence of nnn-vertex graphs in time O(nck)O(n^{ck})O(nck) for fixed k≥Kk \ge Kk≥K, even when only early-round histograms are compared. This addresses the expectation stated by Lichter, Raßmann and Schweitzer.

Formalizing it. No machine-checked proof exists; the source is an unrefereed preprint. A formalization would also give Lean definitions of both WL conventions, reusable by the companion missions in this family on identification and unconditional lower bounds. The ETH consequence (Theorem 1.3) is not part of the Lean goal.

Difficulty

The forward direction (a successful choice yields a distinguishing homomorphism test detected in few rounds) is constructive. The converse is the hard part: one must show that every bounded-treewidth homomorphism test that distinguishes the lifts yields a successful choice, even when bags do not induce cliques, projected images repeat, and some weights vanish. A naive argument that counts only type-preserving homomorphisms fails because non-type-preserving maps also contribute to hom⁡(F,X0)−hom⁡(F,X⋆)\hom(F, X_0) - \hom(F, X_\star)hom(F,X0​)−hom(F,X⋆​).

Formalization scope

  • Graphs are SimpleGraph on finite types; the lifts' vertex types are sigma types of base vertices with parity tags.
  • WL colors are nested Multiset-valued types defined by recursion on the round number; equivalence quantifies over all rounds rrr.
  • The order bound uses orderFactor t = t * 2^(t-2+3*(t-1).choose 2) + 12 * t.choose 3 with natural-number subtraction (harmless since t≥4t \ge 4t≥4).
  • Successful is an existential over dependent tuples; empty domains are allowed, in which case no successful choice exists and the lifts must be equivalent.

The goal is not trivial: the biconditional pins down equivalence exactly, and the detection clause fixes the round.

Needed infrastructure: tree decompositions and homomorphism counts, the Dvořák/Dell–Grohe–Rattan interface for both conventions, and F2\mathbb{F}_2F2​ linear algebra for the parity lifts. Contributions toward either direction of the equivalence are welcome.

Selected references

  • OpenAI, Parity lifts and bounded-treewidth witnesses for Weisfeiler–Leman equivalence, OpenAI Math Release preprint, September 25, 2026. https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Parity-lifts-and-bounded-treewidth-witnesses-for-Weisfeiler-Leman-equivalence-September-25-2026/paper.pdf
  • B. Weisfeiler, A. Leman, The Reduction of a Graph to Canonical Form and the Algebra Which Appears Therein, 1968. https://www.iti.zcu.cz/wl2018/pdf/wl_paper_translation.pdf
  • J.-Y. Cai, M. Fürer, N. Immerman, An Optimal Lower Bound on the Number of Variables for Graph Identification, Combinatorica 12 (1992). https://doi.org/10.1007/BF01305232
  • Z. Dvořák, On Recognizing Graphs by Numbers of Homomorphisms, J. Graph Theory (2010). https://doi.org/10.1002/jgt.20461
  • H. Dell, M. Grohe, G. Rattan, Lovász Meets Weisfeiler and Leman, ICALP 2018. https://doi.org/10.4230/LIPIcs.ICALP.2018.40
  • A. Atserias et al., Quantum and Non-Signalling Graph Isomorphisms, J. Combin. Theory Ser. B (2019). https://doi.org/10.1016/j.jctb.2018.11.002
  • R. Impagliazzo, R. Paturi, On the Complexity of k-SAT, J. Comput. Syst. Sci. (2001). https://doi.org/10.1006/jcss.2000.1727
  • M. Grohe, M. Lichter, D. Neuen, P. Schweitzer, Compressing CFI Graphs and Lower Bounds for the Weisfeiler–Leman Refinements, J. ACM (2025). https://doi.org/10.1145/3727978
  • M. Lichter, S. Raßmann, P. Schweitzer, Computational Complexity of the Weisfeiler–Leman Dimension, CSL 2025. https://doi.org/10.4230/LIPIcs.CSL.2025.13
31 thms2 active usersReviewed
🏆Completed
Complexity Theory·Captain: wurtle

An exponential two-way deterministic state lower bound for one-way livenessResearch Paper

Motivation: the state cost of removing nondeterminism with two-way motion

Two-way deterministic finite automata (2DFAs) recognize exactly the regular languages (Rabin and Scott; Shepherdson, 1959), but letting the head revisit the input can change how much finite control is needed. In 1978 Sakoda and Sipser asked for the state cost of converting one-way and two-way nondeterministic automata into 2DFAs: is a polynomial number of states always enough? They identified a complete witness family BhB_hBh​, now called one-way liveness, whose letters are binary relations on an hhh-element set; a word is live when the product of its letters is nonempty. Lower bounds against unrestricted 2DFAs — whose head may reverse anywhere and arbitrarily often — have been the difficult part of this question.

Background and timeline

  • 1959 — Rabin–Scott and Shepherdson: two-way deterministic automata recognize only regular languages.
  • 1978 — Sakoda and Sipser pose the state-cost question and prove completeness of the liveness family BhB_hBh​ (STOC 1978, Theorem 2.3).
  • 1980 — Sipser: exponential lower bounds for sweeping 2DFAs, which reverse only at endmarkers (J. Comput. System Sci. 21, 1980).
  • 1986 — Chrobak: quadratic lower bounds against unrestricted 2DFAs for unary languages (TCS 1986).
  • 2013 — Kapoutsis extends exponential bounds to 2DFAs with sublinearly many reversals (Inf. Comput. 222, 2013).
  • 2018 — Kapoutsis: optimal Θ(h2/log⁡h)\Theta(h^2/\log h)Θ(h2/logh) for liveness restricted to words of three letters (LNCS 11011, 2018).
  • 2026 — Adeogun and Kapoutsis: a quadratic lower bound for unrestricted 2DFAs against one-way liveness (arXiv:2602.24279). An OpenAI preprint, An exponential two-way deterministic state lower bound for one-way liveness (OpenAI Math Release, September 25, 2026), claims an exponential bound for unrestricted 2DFAs over the growing relation alphabets. The preprint has not been peer reviewed, and its main theorem is not formally verified.

Setting

An automaton has a finite set of states and a read-only head on a word over an alphabet Σ\SigmaΣ, bracketed by two distinct endmarkers. The head starts on the left endmarker in the initial state; each transition depends on the current state and scanned symbol, changes the state, and moves the head left, right or not at all, never across an endmarker. A deterministic rule gives at most one successor (rules may be partial); a nondeterministic rule allows several. Acceptance means some finite computation reaches an accepting state; infinite nonaccepting computations reject. Two conventions are considered: under the first, an accepting initial configuration counts; under the second (positive convention) at least one transition is required. All states are counted.

For H={1,…,h}H=\{1,\dots,h\}H={1,…,h} let RH\mathcal R_HRH​ be the monoid of binary relations on HHH with path-order product, (x,z)∈AB(x,z)\in AB(x,z)∈AB iff (x,y)∈A(x,y)\in A(x,y)∈A and (y,z)∈B(y,z)\in B(y,z)∈B for some yyy, and identity IHI_HIH​. The one-way liveness language is

OWLh={R1⋯Rℓ∈RH∗: R1R2⋯Rℓ≠∅},\mathrm{OWL}_h=\{R_1\cdots R_\ell\in\mathcal R_H^*:\ R_1R_2\cdots R_\ell\neq\varnothing\},OWLh​={R1​⋯Rℓ​∈RH∗​: R1​R2​⋯Rℓ​=∅},

where the empty product is IHI_HIH​, so the empty word is live.

Formalization targets

Goal: Theorem 1.1

For every h≥2h\ge2h≥2:

  1. OWLh\mathrm{OWL}_hOWLh​ is recognized, under both acceptance conventions, by a nondeterministic automaton with h+3h+3h+3 states that never moves left;
  2. every 2DFA with sss states recognizing OWLh\mathrm{OWL}_hOWLh​ satisfies
2⌊(h−2)/31⌋  ≤  4 (s+2)2(positive convention),2⌊(h−2)/31⌋  ≤  4 (s+1)2(initial acceptance counts).2^{\lfloor (h-2)/31\rfloor}\;\le\;4\,(s+2)^2\quad\text{(positive convention)},\qquad 2^{\lfloor (h-2)/31\rfloor}\;\le\;4\,(s+1)^2\quad\text{(initial acceptance counts)}.2⌊(h−2)/31⌋≤4(s+2)2(positive convention),2⌊(h−2)/31⌋≤4(s+1)2(initial acceptance counts).

The goal statement is published on the platform with status Open: no machine-checked proof exists yet.

Significance

The result itself. The theorem gives an exponential separation between one-way nondeterministic automata and unrestricted two-way deterministic automata, improving the quadratic bound of Adeogun and Kapoutsis to an exponential one. Corollary 1.2 of the source deduces that no polynomial CncCn^cCnc bounds the deterministic two-way state cost of nnn-state 2NFAs uniformly over all finite alphabets. The alphabet RH\mathcal R_HRH​ has 2h22^{h^2}2h2 letters, so the result does not address a fixed alphabet or logarithmic-space complexity classes. A companion OpenAI preprint uses the same language to prove an exponential lower bound for complementing 2NFAs.

Formalizing it. The statement is a finite combinatorial claim about two explicit machine models. A formal proof would certify the passage from deterministic computations to products in the Brauer diagram monoid and the rank-loss induction with explicit constants (323232 conjugates, 256256256 additions, step 313131).

Difficulty

Earlier exponential bounds rely on restricting how often the deterministic head reverses; an unrestricted 2DFA may revisit a cell arbitrarily often as input length grows, and crossing-sequence arguments then lose control. The central obstacle is to represent repeated visits to a cell by an object that depends only on that cell's symbol, not on its neighbors, so that the machine induces a monoid map onto the relation monoid. Once such a representation exists, one still needs a lower bound on its size that grows exponentially in hhh rather than polynomially.

Formalization scope

  • Letters are BRel (Fin h), a structure wrapping Fin h → Fin h → Prop, with the monoid structure given by path-order composition and identity Eq; OWL h is the set of words whose List.prod relates some pair.
  • Symbol Alpha adds left and right endmarkers; moves are left | stay | right; head positions are Fin (w.length + 2) and Move.Rel fixes the position change.
  • NMachine Alpha n and DMachine Alpha s have state types Fin n, Fin s, a set of accepting states, set-valued or Option-valued transitions, and boundary axioms forbidding left moves on the left endmarker and right moves on the right endmarker.
  • FiniteRun positive uses TransGen (at least one step) when positive = true and ReflTransGen otherwise; Recognizes positive L means acceptance exactly on L.
  • NoLeft forbids left moves in the source automaton. The recognizer clause quantifies over both conventions with the same machine.
  • The bound is in natural numbers with floor division (h - 2) / 31, and s ranges over all natural numbers (an s = 0 machine has no states and cannot recognize the language).
  • Infrastructure needed: Brauer (matching) diagram monoids with rank and idempotents, relation monoids, and the tour construction turning deterministic computations into diagrams. The diagram-monoid layer is reusable for other two-way automata lower bounds.

Selected references

  • M. O. Rabin, D. Scott, Finite automata and their decision problems, IBM J. Res. Develop. 3 (1959), 114–125.
  • J. C. Shepherdson, The reduction of two-way automata to one-way automata, IBM J. Res. Develop. 3 (1959), 198–200.
  • W. J. Sakoda, M. Sipser, Nondeterminism and the size of two way finite automata, STOC 1978, 275–286. https://doi.org/10.1145/800133.804357
  • M. Sipser, Lower bounds on the size of sweeping automata, J. Comput. System Sci. 21 (1980), 195–202.
  • M. Chrobak, Finite automata and unary languages, Theoret. Comput. Sci. 47 (1986), 149–158. https://doi.org/10.1016/0304-3975(86)90142-8
  • C. Kapoutsis, Nondeterminism is essential in small two-way finite automata with few reversals, Inform. and Comput. 222 (2013), 208–227.
  • C. A. Kapoutsis, Optimal 2DFA algorithms for one-way liveness on two and three symbols, LNCS 11011 (2018), 33–48.
  • K. Adeogun, C. Kapoutsis, A quadratic lower bound for 2DFAs against one-way liveness, preprint (2026). https://doi.org/10.48550/arXiv.2602.24279
  • R. Brauer, On algebras which are connected with the semisimple continuous groups, Ann. of Math. 38 (1937), 857–872.
  • OpenAI, An exponential state lower bound for two-way nondeterministic complementation, OpenAI Math Release preprint, September 25, 2026. https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/An-exponential-state-lower-bound-for-two-way-nondeterministic-complementation-September-25-2026/paper.pdf
  • OpenAI, An exponential two-way deterministic state lower bound for one-way liveness, OpenAI Math Release preprint, September 25, 2026 (source of the goal; Theorem 1.1, p. 2). https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/An-exponential-two-way-deterministic-state-lower-bound-for-one-way-liveness-September-25-2026/main.pdf
18 thms2 active usersReviewed
🏆Completed
Captain: marwahaha

Matrix multiplication exponent ≤ 2.25 over every fieldResearch Paper

Motivation

This mission asks for a formal proof that the matrix multiplication exponent is at most 2.25=9/42.25=9/42.25=9/4 over every field. It is proposed for the Matrix multiplication exponent campaign, using the campaign's existing tensor-rank definition. The target is deliberately non-strict: equality with 9/49/49/4 is allowed.

The starting point is OpenAI's October 2026 matrix-multiplication material, whose original arithmetic-exponent theorem is stated over the complex numbers. An all-fields adaptation has been checked separately in Lean. This mission asks for the corresponding result in the campaign's precise mathematical model; that connection still requires proof.

Setting

Let KKK be any field, finite or infinite and in any characteristic. For a positive integer nnn, the square matrix multiplication tensor is the sum of eij⊗ejk⊗ekie_{ij}\otimes e_{jk}\otimes e_{ki}eij​⊗ejk​⊗eki​ over all indices i,j,k<ni,j,k<ni,j,k<n. Each factor is the vector space of functions from pairs of indices to KKK. Its tensor rank is the least number of pure tensors in an exact decomposition over KKK.

The imported definition MME.matMulExp takes the infimum of the ratios log⁡RK(MMn)/log⁡n\log R_K(MM_n)/\log nlogRK​(MMn​)/logn for integer n≥2n\ge2n≥2, together with the value 333 at sizes zero and one. The goal refers to this existing definition without modifying it. An upper bound on the infimum need not be attained at any one matrix size.

Target

For every field KKK, prove

MME.matMulExp⁡(K)≤2.25=94.\operatorname{MME.matMulExp}(K)\le 2.25=\frac94.MME.matMulExp(K)≤2.25=49​.

The Lean theorem is mme_omega_le_225, with the sole typeclass hypothesis [Field K]. The decimal is interpreted exactly as a real rational, not as a floating-point approximation. There is no restriction to characteristic zero, infinite fields, algebraically closed fields, or the complex numbers.

The campaign template currently uses a strict inequality. This proposal intentionally requests the non-strict bound ≤2.25\le2.25≤2.25 and should be reviewed on that basis. It does not assert ω<2.25\omega<2.25ω<2.25. The proposed numeric campaign value is 2.252.252.25.

Significance

A proof of this goal would place the nine-fourths bound in the same formal tensor-rank model used by other entries in this campaign. Reusing the foundation makes its assumptions and numeric value directly inspectable. Establishing the comparison between the arithmetic and tensor formulations would also produce reusable results for future matrix multiplication missions.

The all-fields quantifier matters: constructions that use interpolation or roots of unity must justify their applicability and any descent back to the original field. A result over the complex numbers alone does not establish this goal.

Difficulty

The available checked adaptation proves the nine-fourths bound for the OAI arithmetic exponent and its exact-rank exponent. A remaining task is to connect that exact-rank representation to the campaign's tensor product and rank definition. This requires checking the coordinate conventions, converting rank decompositions, and transporting the bound through the infimum and logarithms.

The proof must also compile in the campaign's pinned Lean environment. Success in a different Lean or Mathlib version is useful evidence for the source proof, but it does not verify this mission's theorem.

Formalization scope

This draft imports the campaign's published mme_omega definition and contains one open goal. It preserves the campaign environment, Mathlib 777aaa6 with Lean 4.29.0-rc3. The separate all-fields OAI adaptation was checked using Lean 4.33.1 and Mathlib 0df444a360eaa60ab8c11dca51a86af692955474; its proof is not yet an accepted Prove2me solution to this goal.

In particular, the bridge to MME.matMulExp and the environment port remain unproved here. The mission should remain open until Prove2me accepts a proof of this exact statement. An independent auditor read the Lean goal and imported definition without seeing the intended wording; that read-back is included verbatim in the goal's natural-language statement for review.

Selected references

  • OpenAI matrix multiplication preprint, October 2, 2026.
  • OpenAI ComparatorChallenges Lean source.
  • Matrix multiplication exponent campaign.

The all-fields adaptation and the proposed connection to the campaign definition are additional formalization work; they are not attributed to the original complex-field statement.

4 thms2 active usersReviewed
🏆Completed
Combinatorics·Captain: xuanji

Deterministic APSP in O(n^2.996001) time on a Word RAMResearch Paper

Motivation

All-pairs shortest paths (APSP) asks for the exact distance between every ordered pair of vertices in an nnn-vertex weighted directed graph. Floyd–Warshall solves it in O(n3)O(n^3)O(n3) time, and for decades no algorithm beat n3−δn^{3-\delta}n3−δ for any constant δ>0\delta>0δ>0 on graphs with polynomially bounded integer weights. In 2026, Alman and Vassilevska Williams (arXiv:2610.06783) gave a deterministic O(n2.99942)O(n^{2.99942})O(n2.99942) algorithm, the campaign's first entry. Later entries tightened the accounting to 2.99832.99832.9983 and 2.997912.997912.99791.

This entry records the deterministic exponent 2.9960012.9960012.996001. It roughly doubles the saving below 333 compared with 2.997912.997912.99791, and it matches what was previously only known with randomized hashing.

Setting

The model is the campaign's fixed deterministic word RAM (foundation mission: Truly Subcubic APSP on a Word RAM). A finite program uses add, subtract and multiply modulo 2W2^W2W, indirect load and store, a sign branch, and accept or reject, on words of width W≥b(log⁡2n+1)W \ge b(\log_2 n + 1)W≥b(log2​n+1). Inputs have integer weights of absolute value at most nκn^\kappanκ for a fixed κ\kappaκ, and there are no negative cycles. The machine has no source of randomness; the algorithm behind this entry is deterministic.

Formalization target

The goal is the campaign template with the value 2.9960012.9960012.996001:

TrulySubcubicAPSP.APSP.SolvedInTime 2.996001,\texttt{TrulySubcubicAPSP.APSP.SolvedInTime}\ 2.996001,TrulySubcubicAPSP.APSP.SolvedInTime 2.996001,

which says there is a deterministic word-RAM program that solves APSP in O(n2.996001)O(n^{2.996001})O(n2.996001) steps.

How the bound arises

The algebraic core is the thin-product data structure of Alman and Vassilevska Williams: for an N×DN\times DN×D by D×ND\times ND×N integer product it answers requested entries WWW in O~(N2D−Γ+NDa+∣W∣Dq)\tilde O(N^2D^{-\Gamma} + N D^{a} + |W| D^{q})O~(N2D−Γ+NDa+∣W∣Dq). Two local refinements of that construction sharpen the exponents:

  1. Pruned encodings. Encoding branches with more than mmm copies of the distinguished symbol P0P_0P0​ are never materialized, giving a(c)=(12cH(1/c)+(c−1)ln⁡3)/ln⁡4a(c) = \bigl(\tfrac12 cH(1/c) + (c-1)\ln 3\bigr)/\ln 4a(c)=(21​cH(1/c)+(c−1)ln3)/ln4.
  2. Exact binomial tail. The box preprocessing is bounded by its actual binomial sum, giving Γ(c,θ)=(cH(1/c)−cH((1−θ)/c)−θln⁡9)/ln⁡4\Gamma(c,\theta) = \bigl(cH(1/c) - cH((1-\theta)/c) - \theta\ln 9\bigr)/\ln 4Γ(c,θ)=(cH(1/c)−cH((1−θ)/c)−θln9)/ln4, with q(θ)=(H(θ)+θln⁡9)/ln⁡4q(\theta) = \bigl(H(\theta)+\theta\ln 9\bigr)/\ln 4q(θ)=(H(θ)+θln9)/ln4.

The main new step is a deterministic filtering reduction. Moduli are chosen one small prime factor at a time, using exact thin-product witness counts to certify positive answers and to eliminate whole blocks of unresolved queries. Repeated filtering removes the need to scan individual modular witnesses, which was the bottleneck of earlier deterministic reductions (the prime-by-prime idea is suggested in footnote 9 of the source paper, after Fischer, Kaliciak and Polak). With middle blocks of size nε/2n^{\varepsilon/2}nε/2 this yields all-edges Exact Triangle in n3−δ+o(1)n^{3-\delta+o(1)}n3−δ+o(1), where

δ=min⁡{εΓ, 1−εa, ε(1/2−q)},\delta = \min\{\varepsilon\Gamma,\ 1-\varepsilon a,\ \varepsilon(1/2-q)\},δ=min{εΓ, 1−εa, ε(1/2−q)},

and deterministic bit scaling transfers the bound to min-plus product and APSP with polylogarithmic overhead.

The exact rational parameters c=21.2733c = 21.2733c=21.2733, θ=0.111731\theta = 0.111731θ=0.111731 and ε=0.056846\varepsilon = 0.056846ε=0.056846 satisfy the thin regime ε(a+Γ)<1\varepsilon(a+\Gamma) < 1ε(a+Γ)<1 with margin 1.16×10−61.16\times10^{-6}1.16×10−6, and give δ>0.00399928\delta > 0.00399928δ>0.00399928. Hence APSP runs in n2.99600072+o(1)n^{2.99600072+o(1)}n2.99600072+o(1), and the gap 2.996001−2.99600072>02.996001 - 2.99600072 > 02.996001−2.99600072>0 absorbs the subpolynomial factor.

Significance

This is the first deterministic entry near 2.9962.9962.996. Earlier analyses reached about 2.996012.996012.99601 only by repeating random-prime hashing, which this word-RAM model cannot express. The deterministic filtering closes that gap.

Selected references

  • J. Alman and V. Vassilevska Williams, Truly Subquadratic 3SUM and Truly Subcubic APSP via Triangles in Sparse Lopsided Graphs (2026). https://arxiv.org/abs/2610.06783
  • Deterministic APSP in O(n2.996001)O(n^{2.996001})O(n2.996001): an explicit refinement of the thin-product method, technical note, 6 October 2026. This is the source of 2.9960012.9960012.996001 and has not been peer reviewed.
5 thms2 active usersReviewed
🏆Completed
Machine LearningOperations Research·Captain: mikedeng1

The Weighted Majority Algorithm 5: With Pool Predictions in [0,1], the Binary Master WMG Makes at Most log(w_init/w_fin)/log(2/(1+β)) MistakesResearch Paper

Motivation

Prediction with expert advice asks how a learner should combine the forecasts of a pool of prediction algorithms when nothing is assumed about the data: the instances and labels may be chosen by an adversary, and the learner's performance is compared with that of the pool. Littlestone and Warmuth's The Weighted Majority Algorithm (Inform. and Comput. 108, 1994) introduced the multiplicative-weights master algorithm WM for binary pool predictions and proved that its number of mistakes is at most logarithmic in the pool size plus a constant times the mistakes of the best pool member. The same multiplicative update now underlies boosting, online convex optimization and approximate solvers for linear programs and zero-sum games (Arora, Hazan, Kale 2012).

In many applications the pool members do not output a bit but a degree of confidence in [0,1][0,1][0,1], while the master must still commit to a binary decision. Section 5 of the paper treats exactly this setting with the algorithm WMG, and shows that WM's mistake bound survives unchanged.

Setting

A nonempty pool of nnn prediction algorithms is run on a finite sequence of trials. In trial kkk the pool member iii predicts xk,i∈[0,1]x_{k,i}\in[0,1]xk,i​∈[0,1], the master predicts λk∈{0,1}\lambda_k\in\{0,1\}λk​∈{0,1}, and then the binary label ρk∈{0,1}\rho_k\in\{0,1\}ρk​∈{0,1} is revealed. The master keeps a non-negative weight wk,iw_{k,i}wk,i​ per pool member, with positive initial weights. Write

sk=∑i=1nwk,i,γk=∑i=1nwk,i xk,isk,s_k=\sum_{i=1}^n w_{k,i},\qquad \gamma_k=\frac{\sum_{i=1}^n w_{k,i}\,x_{k,i}}{s_k},sk​=i=1∑n​wk,i​,γk​=sk​∑i=1n​wk,i​xk,i​​,

and winit=s0w_{\mathrm{init}}=s_0winit​=s0​, wfinw_{\mathrm{fin}}wfin​ the total weight after the last trial.

WMG with parameter 0≤β<10\le\beta<10≤β<1 predicts λk=1\lambda_k=1λk​=1 if γk>1/2\gamma_k>1/2γk​>1/2 and λk=0\lambda_k=0λk​=0 if γk<1/2\gamma_k<1/2γk​<1/2; at γk=1/2\gamma_k=1/2γk​=1/2 either prediction is allowed. A mistake is a trial with λk≠ρk\lambda_k\ne\rho_kλk​=ρk​, and mmm is the number of mistakes. An update step multiplies every weight by a factor

wk+1,i=F wk,i,β∣xk,i−ρk∣≤F≤1−(1−β) ∣xk,i−ρk∣(5.1)w_{k+1,i}=F\,w_{k,i},\qquad \beta^{|x_{k,i}-\rho_k|}\le F\le 1-(1-\beta)\,|x_{k,i}-\rho_k| \tag{5.1}wk+1,i​=Fwk,i​,β∣xk,i​−ρk​∣≤F≤1−(1−β)∣xk,i​−ρk​∣(5.1)

with 00=10^0=100=1. WMG executes an update step in every trial, or only in mistake trials; more generally (footnote 8 of the paper) in every mistake trial and possibly in others. Outside update steps the weights do not change. When the xk,ix_{k,i}xk,i​ are binary, WMG coincides with WM.

Formalization targets

Goal: Theorem 5.1 (pp. 234–235)

For every run of WMG with 0≤β<10\le\beta<10≤β<1, whatever the tie-breaking, the update criterion and the factors in (5.1), if wfin>0w_{\mathrm{fin}}>0wfin​>0 then

m≤ln⁡(winit/wfin)ln⁡(2/(1+β)).m\le\frac{\ln(w_{\mathrm{init}}/w_{\mathrm{fin}})}{\ln\bigl(2/(1+\beta)\bigr)}.m≤ln(2/(1+β))ln(winit​/wfin​)​.

The bound involves only the total weights, not the losses of individual pool members; Corollary 5.1 of the paper, which compares mmm with the total absolute loss mim_imi​ of each pool member, follows from it and from the lower bound in (5.1).

Milestones

  1. Appendix, p. 256. In a mistake trial the total weight drops by at least a factor (1+β)/2(1+\beta)/2(1+β)/2: sk+1≤1+β2sks_{k+1}\le\frac{1+\beta}{2}s_ksk+1​≤21+β​sk​.
  2. §5, p. 235. Unless β=0\beta=0β=0 and ∣γk−ρk∣=1|\gamma_k-\rho_k|=1∣γk​−ρk​∣=1 in some update trial,
∑k updateln⁡(1−(1−β)∣γk−ρk∣)≤∑k mistakeln⁡(1−(1−β)∣γk−ρk∣)≤mln⁡(12+12β).\sum_{k\ \text{update}}\ln\bigl(1-(1-\beta)|\gamma_k-\rho_k|\bigr)\le\sum_{k\ \text{mistake}}\ln\bigl(1-(1-\beta)|\gamma_k-\rho_k|\bigr)\le m\ln\bigl(\tfrac12+\tfrac12\beta\bigr).k update∑​ln(1−(1−β)∣γk​−ρk​∣)≤k mistake∑​ln(1−(1−β)∣γk​−ρk​∣)≤mln(21​+21​β).

The paper gives two proofs of Theorem 5.1, one through each milestone; the second also uses Lemma 5.2, the potential lemma shared with the continuous master WMC, which is posed in the companion mission on WMC.

Significance

Theorem 5.1 says that the master's mistake count is controlled by how much total weight the pool loses, with the same constant 1/ln⁡(2/(1+β))1/\ln(2/(1+\beta))1/ln(2/(1+β)) as for binary pools. With equal initial weights it gives Corollary 5.1: WMG makes at most (log⁡n+milog⁡(1/β))/log⁡(2/(1+β))(\log n+m_i\log(1/\beta))/\log(2/(1+\beta))(logn+mi​log(1/β))/log(2/(1+β)) mistakes for every pool member iii, so pool members may report graded confidences at no cost in the master's guarantee. The same weight-potential argument is the template for the randomized master WMR of §6 and for later analyses of exponential weights.

The result is classical and proved in the paper. What this mission adds is a machine-checked statement and proof against the paper's own model: a relation that covers both update criteria, all tie-breaks at γ=1/2\gamma=1/2γ=1/2 and the whole interval of admissible factors, rather than a single deterministic instance. No formalization of WMG or of Theorem 5.1 is known; the platform's existing weighted-majority results (Hazan's textbook version) concern binary experts, unit initial weights and a fixed update factor.

Difficulty

The obvious argument, copied from WM, tracks the weight q0q_0q0​ of members predicting 000 and the weight q1q_1q1​ of members predicting 111. With predictions in [0,1][0,1][0,1] a member supports both outcomes, and the update factor is only constrained to an interval, so the two-bucket bookkeeping must be redone for fractional contributions. The factor's upper bound 1−(1−β)r1-(1-\beta)r1−(1−β)r is affine in r=∣x−ρ∣r=|x-\rho|r=∣x−ρ∣, while the natural exponential factor βr\beta^rβr is convex; the argument must use the right one of the two bounds of (5.1). A further subtlety is the case β=0\beta=0β=0: a factor may be 000, the total weight can vanish, and both the logarithmic bound and the weighted average γ\gammaγ degenerate.

Formalization scope

  • The pool is Fin n with n>0n>0n>0, and the trials are Fin T, all trials of the sequence; weights are w : ℕ → Fin n → ℝ, with w 0 the initial and w T the final weights.
  • Pool predictions are real numbers in [0,1][0,1][0,1], labels and master predictions are real numbers in {0,1}\{0,1\}{0,1}.
  • The update criterion is a Boolean flag per trial that must be set in every mistake trial; the factor is an arbitrary real number in the interval (5.1) for each trial and member, where βr\beta^{r}βr is Real.rpow (so 00=10^0=100=1).
  • The paper writes a ratio of logarithms with the base omitted; Real.log is used.
  • The case wfin=0w_{\mathrm{fin}}=0wfin​=0, where the paper's bound is +∞+\infty+∞, is excluded by the hypothesis 0<wfin0<w_{\mathrm{fin}}0<wfin​. Without it, Lean's Real.log 0 = 0 would turn the paper's vacuous bound into the false claim m≤0m\le0m≤0; with it, no Lean junk value enters the statement.
  • The goal must be stated for the relation, not for a single run: fixing the tie-break, updating in every trial only, or fixing FFF to one endpoint of (5.1) would state a special case. Stating the theorem only for binary pool predictions would state Theorem 2.1 instead.

A complete development needs only finite sums, real logarithms and real powers from Mathlib. Proofs of either milestone, of the existence of a run for every input (using Lemma 5.1, βr≤1+r(β−1)\beta^r\le1+r(\beta-1)βr≤1+r(β−1)), and of Corollary 5.1 on top of the goal are welcome.

Selected references

  • N. Littlestone, M. K. Warmuth, The Weighted Majority Algorithm, Information and Computation 108(2), 212–261, 1994. https://doi.org/10.1006/inco.1994.1009
  • N. Littlestone, M. K. Warmuth, The Weighted Majority Algorithm, Proc. 30th IEEE FOCS, 256–261, 1989. https://doi.org/10.1109/SFCS.1989.63487
  • V. Vovk, Aggregating Strategies, Proc. 3rd COLT, 371–383, 1990. https://dl.acm.org/doi/10.5555/92571.92672
  • S. Arora, E. Hazan, S. Kale, The Multiplicative Weights Update Method: a Meta-Algorithm and Applications, Theory of Computing 8, 121–164, 2012. https://doi.org/10.4086/toc.2012.v008a006
5 thms2 active usersReviewed
🏆Completed
AlgebraCombinatoricsInformation Theory·Captain: mikedeng1

Fuzzy Extractors: How to Generate Strong Keys from Biometrics and Other Noisy Data 2: The Improved Juels–Sudan Sketch Is an Average-Case Secure Sketch for s-Element Sets with Entropy Loss t log nResearch Paper

Motivation

Many security-relevant inputs are noisy and do not repeat exactly: fingerprint minutiae, iris codes, lists of personal preferences, the set of features extracted from a document. A cryptographic key derived from such an input must be reproducible from a later, slightly different reading, without storing the input itself. Dodis, Ostrovsky, Reyzin and Smith (SIAM J. Comput. 38(1), 2008; arXiv:cs/0602007) introduced secure sketches for this purpose: public helper data that lets the holder of a nearby reading recover the original exactly, while revealing as little as possible about it.

When the input is a set of features, the natural distance is the size of the symmetric difference. Juels and Sudan proposed the fuzzy vault for this setting (Des. Codes Cryptogr. 38, 2006). Section 6.2 of Dodis et al. gives a simpler, deterministic variant, the improved Juels–Sudan sketch (Construction 5), whose storage and entropy loss are both tlog⁡nt\log ntlogn for sss-element subsets of an nnn-element universe, independent of sss. The paper's Theorem 6.1 is the analysis of that construction. This mission formalizes it.

Setting

Laws and average min-entropy. A random variable is identified with its law. For a pair (A,B)(A,B)(A,B),

H~∞(A∣B)=−log⁡2∑bmax⁡aPr⁡[A=a∧B=b],\tilde H_\infty(A\mid B) = -\log_2 \sum_b \max_a \Pr[A=a \wedge B=b],H~∞​(A∣B)=−log2​b∑​amax​Pr[A=a∧B=b],

which equals −log⁡2Eb←B[max⁡aPr⁡[A=a∣B=b]]-\log_2 \mathbb E_{b\leftarrow B}\big[\max_a\Pr[A=a\mid B=b]\big]−log2​Eb←B​[maxa​Pr[A=a∣B=b]], the average min-entropy of §2.4: the negative logarithm of the best probability of guessing AAA after seeing BBB.

Secure sketches. Let M\mathcal MM be a set with an integer-valued distance dis\mathrm{dis}dis. A pair of procedures (SS,Rec)(\mathsf{SS},\mathsf{Rec})(SS,Rec) is an average-case (M,m,m~,t)(\mathcal M,m,\tilde m,t)(M,m,m~,t)-secure sketch (Definitions 3 and 4) if

  1. (correctness) dis(w,w′)≤t\mathrm{dis}(w,w')\le tdis(w,w′)≤t implies Rec(w′,SS(w))=w\mathsf{Rec}(w',\mathsf{SS}(w))=wRec(w′,SS(w))=w;
  2. (security) for all random variables WWW over M\mathcal MM and III with H~∞(W∣I)≥m\tilde H_\infty(W\mid I)\ge mH~∞​(W∣I)≥m, one has H~∞(W∣(SS(W),I))≥m~\tilde H_\infty(W\mid (\mathsf{SS}(W),I))\ge\tilde mH~∞​(W∣(SS(W),I))≥m~.

The difference m−m~m-\tilde mm−m~ is the entropy loss.

The metric. For a finite universe U\mathcal UU with n=∣U∣n=|\mathcal U|n=∣U∣, SDifs(U)\mathrm{SDif}_s(\mathcal U)SDifs​(U) is the set of sss-element subsets of U\mathcal UU with dis(w,w′)=∣w△w′∣\mathrm{dis}(w,w')=|w\triangle w'|dis(w,w′)=∣w△w′∣.

Construction 5. Identify U\mathcal UU with a finite field F\mathcal FF of nnn elements and let t≤st\le st≤s.

  • SS(w)\mathsf{SS}(w)SS(w): form p′(z)=∏x∈w(z−x)p'(z)=\prod_{x\in w}(z-x)p′(z)=∏x∈w​(z−x), monic of degree sss, and output its coefficients as−1,…,as−ta_{s-1},\dots,a_{s-t}as−1​,…,as−t​ of degree s−1s-1s−1 down to s−ts-ts−t.
  • Rec(w′,(as−1,…,as−t))\mathsf{Rec}(w',(a_{s-1},\dots,a_{s-t}))Rec(w′,(as−1​,…,as−t​)): form phigh(z)=zs+∑i=s−ts−1aizip_{\mathrm{high}}(z)=z^s+\sum_{i=s-t}^{s-1}a_iz^iphigh​(z)=zs+∑i=s−ts−1​ai​zi; find a polynomial plowp_{\mathrm{low}}plow​ of degree at most s−t−1s-t-1s−t−1 that agrees with phighp_{\mathrm{high}}phigh​ on at least s−t/2s-t/2s−t/2 points of w′w'w′ (Reed–Solomon decoding); output the roots of phigh−plowp_{\mathrm{high}}-p_{\mathrm{low}}phigh​−plow​.

The Lean development names these charPoly, sketchCoeffs, sketch, pHigh, Step3Cond and recover, and the metric SDifS with distance sdifDist, in the namespace FuzzyExtractors.ImprovedJS.

Formalization targets

Goal: Theorem 6.1

For every finite field F\mathcal FF with nnn elements, all t≤st\le st≤s and every real mmm,

(SS,Rec) is an average-case (SDifs(F), m, m−tlog⁡2n, t)-secure sketch.(\mathsf{SS},\mathsf{Rec})\ \text{is an average-case}\ \big(\mathrm{SDif}_s(\mathcal F),\,m,\,m-t\log_2 n,\,t\big)\text{-secure sketch}.(SS,Rec) is an average-case (SDifs​(F),m,m−tlog2​n,t)-secure sketch.

The goal is uniform in mmm: the entropy loss tlog⁡nt\log ntlogn does not depend on the input distribution.

Milestones (the correctness half)

The paper's argument on p. 21 splits into four steps, each a milestone:

  1. p′=phigh+qp'=p_{\mathrm{high}}+qp′=phigh​+q with deg⁡q≤s−t−1\deg q\le s-t-1degq≤s−t−1, and phigh=−qp_{\mathrm{high}}=-qphigh​=−q on www;
  2. ∣w△w′∣≤t|w\triangle w'|\le t∣w△w′∣≤t implies ∣w∩w′∣≥s−t/2|w\cap w'|\ge s-t/2∣w∩w′∣≥s−t/2, so −q-q−q is a valid plowp_{\mathrm{low}}plow​;
  3. any two valid plowp_{\mathrm{low}}plow​ coincide;
  4. Rec(w′,SS(w))=w\mathsf{Rec}(w',\mathsf{SS}(w))=wRec(w′,SS(w))=w whenever ∣w△w′∣≤t|w\triangle w'|\le t∣w△w′∣≤t.

A fifth, off the goal's path, records Step 2's remark that the sketch consists of the first ttt elementary symmetric polynomials of www, up to sign.

The security half is the entropy bound: since SS\mathsf{SS}SS takes at most ntn^tnt values, H~∞(W∣(SS(W),I))≥H~∞(W∣I)−tlog⁡n\tilde H_\infty(W\mid(\mathsf{SS}(W),I))\ge\tilde H_\infty(W\mid I)-t\log nH~∞​(W∣(SS(W),I))≥H~∞​(W∣I)−tlogn (the paper cites its Lemma 3.1, which is posed in the first mission of this series and is not restated here).

Significance

The result. Theorem 6.1 gives a secure sketch for set difference whose sketch length and entropy loss are tlog⁡nt\log ntlogn, which the paper shows is essentially optimal when n≫sn\gg sn≫s (§6.2, via Lemma C.1 and a constant-weight code bound). It improves the original fuzzy vault, whose entropy loss the paper analyses in Appendix D and finds good only when the stored data is very large. Through the paper's generic composition with randomness extractors (Lemma 4.1), it yields fuzzy extractors for set-valued inputs in large universes, the regime of biometric feature sets.

Formalizing it. The theorem is proved in the paper; no machine-checked version exists on Prove2Me or, to our knowledge, elsewhere. A formal proof combines three pieces of reusable infrastructure: a probabilistic layer (average min-entropy of laws on arbitrary types, and the chain-rule-type bound for a function with few values), the combinatorics of symmetric differences of equal-size sets, and the algebra of Reed–Solomon unique decoding (a low-degree polynomial is determined by its values on enough points). Each of these is useful beyond this mission.

Difficulty

No step is deep; the difficulty is in the bookkeeping. The correctness argument relies on exact degree accounting: phighp_{\mathrm{high}}phigh​ must agree with p′p'p′ in every coefficient of degree at least s−ts-ts−t, so that the remainder has degree at most s−t−1s-t-1s−t−1, and the uniqueness count ("two candidates agree on at least s−ts-ts−t points") requires the threshold to be at least s−t/2s-t/2s−t/2; the paper's sentence says "more than", which does not support the argument as written. The roots of phigh−plowp_{\mathrm{high}}-p_{\mathrm{low}}phigh​−plow​ must be shown to form exactly the set www, with no multiplicities lost. The security half needs the average min-entropy of a joint law with a deterministic, ntn^tnt-valued component bounded uniformly over all auxiliary variables, including those with infinite or uncountable range, where sums are infinite sums of extended nonnegative reals.

Formalization scope

Conventions committed to in Lean:

  • Laws are PMFs; the procedures are kernels M → PMF S, here deterministic (PMF.pure). Average min-entropy is the joint form above, logarithms base 2, and the auxiliary III ranges over an arbitrary ι : Type (a superset of the paper's {0,1}∗\{0,1\}^*{0,1}∗), never restricted to finite types.
  • The universe is the field F\mathcal FF itself, [Field 𝔽] [Fintype 𝔽], with nnn = Fintype.card 𝔽; the paper's "nnn is a prime power" is then automatic.
  • The paper leaves t≤st\le st≤s implicit; every statement assumes it. No parity condition on ttt is imposed: "at least s−t/2s-t/2s−t/2" is written 2⋅#≥2s−t2\cdot\#\ge 2s-t2⋅#≥2s−t in N\mathbb NN, which covers odd ttt.
  • "Degree at most s−t−1s-t-1s−t−1" is degree < s - t, so plow=0p_{\mathrm{low}}=0plow​=0 when t=st=st=s.
  • The sketch is a vector in Ft\mathcal F^tFt indexed from 000: entry iii is the coefficient of degree s−1−is-1-is−1−i. The storage bound tlog⁡nt\log ntlogn holds by this type and is not restated.
  • Rec\mathsf{Rec}Rec takes an arbitrary valid plowp_{\mathrm{low}}plow​ (by choice) instead of running a decoding algorithm. The paper's "fail" output is encoded as returning w′w'w′, which only occurs when correctness makes no claim.
  • Running time is out of scope. Theorem 6.1's clause that SS\mathsf{SS}SS and Rec\mathsf{Rec}Rec run in time polynomial in sss, ttt and log⁡n\log nlogn is dropped, and no surrogate predicate replaces it.

A formalization that checks only correctness, drops or trivializes the entropy clause, or lets Rec\mathsf{Rec}Rec see www itself, would not be Theorem 6.1. The goal states both clauses through the definition of an average-case secure sketch, with Rec\mathsf{Rec}Rec given only w′w'w′ and the sketch.

Contributions welcome: proofs of the milestones, a general lemma bounding average min-entropy loss by the logarithm of the number of sketch values (the paper's Lemma 2.2(b) and Lemma 3.1), and Reed–Solomon uniqueness lemmas stated for reuse.

Selected references

  • Y. Dodis, R. Ostrovsky, L. Reyzin, A. Smith, Fuzzy Extractors: How to Generate Strong Keys from Biometrics and Other Noisy Data, SIAM J. Comput. 38(1):97–139, 2008. https://doi.org/10.1137/060651380 ; arXiv:cs/0602007v4, https://arxiv.org/abs/cs/0602007
  • A. Juels, M. Sudan, A Fuzzy Vault Scheme, Designs, Codes and Cryptography 38(2):237–257, 2006. https://doi.org/10.1007/s10623-005-6343-z
  • E. Agrell, A. Vardy, K. Zeger, Upper Bounds for Constant-Weight Codes, IEEE Trans. Inform. Theory 46(7):2373–2395, 2000. https://doi.org/10.1109/18.887851
8 thms2 active usersReviewed
🏆Completed
Combinatorics·Captain: marwahaha

3SUM in O(n^1.999112) Time on a Word RAMResearch Paper

Improve deterministic integer 3SUM to O(n1.999112)O(n^{1.999112})O(n1.999112) time in the foundation mission’s word-RAM model.

The existing Corollary 26 routine admits the tighter bound O(wD0.436+n2/D0.064)O(wD^{0.436}+n^2/D^{0.064})O(wD0.436+n2/D0.064). Keep D=⌊n1/18⌋D=\lfloor n^{1/18}\rfloorD=⌊n1/18⌋ and change the grouping parameter to g=⌈D0.032⌉g=\lceil D^{0.032}\rceilg=⌈D0.032⌉, implemented using the integer root of D4D^4D4 of order 125125125. Balancing the instance costs and scans gives an Exact Triangle saving of 2/11252/11252/1125, and the verified 3SUM reduction gives n2249/1125+o(1)n^{2249/1125+o(1)}n2249/1125+o(1) time.

The supporting theorem establishes every rational exponent r>2249/1125=1.999111…r>2249/1125=1.999111\ldotsr>2249/1125=1.999111…, including 1.9991121.9991121.999112. This changes the algorithm’s grouping parameter and improves the earlier cutoff 1.9991251.9991251.999125. All other model definitions and the shared reduction lemmas are reused.

3 thms2 active usersReviewed
🏆Completed
Combinatorics·Captain: marwahaha

3SUM in O(n^1.99913) Time on a Word RAMResearch Paper

Prove deterministic O(n1.99913)O(n^{1.99913})O(n1.99913) time for 3SUM on polynomially bounded integers, using the same word-RAM model and definitions as the foundation mission.

The existing uniform Exact Triangle bound has saving δ=0.00175\delta=0.00175δ=0.00175. The verified 3SUM reduction yields n2−δ/2+o(1)=n1.999125+o(1)n^{2-\delta/2+o(1)}=n^{1.999125+o(1)}n2−δ/2+o(1)=n1.999125+o(1) time, so every fixed rational exponent above 1.9991251.9991251.999125 is attainable, including 1.999131.999131.99913. This mission sharpens the bound extracted from the existing algorithm.

The supporting theorem covers all rational r>1.999125r>1.999125r>1.999125; it does not assert an exact O(n1.999125)O(n^{1.999125})O(n1.999125) bound. The proof reuses the shared, proved APSP and 3SUM lemmas from Anthropic’s formalization.

3 thms2 active usersReviewed
🏆Completed
Machine LearningOperations Research·Captain: mikedeng1

The Weighted Majority Algorithm 1: WM Makes at Most log(w_init/w_fin)/log(2/(1+β)) Mistakes on Any SequenceResearch Paper

Motivation

In online prediction, a learner makes a forecast before seeing the next label. A collection of other forecasters may offer useful advice, but the learner need not know beforehand which forecaster will perform well. Littlestone and Warmuth's Weighted Majority Algorithm (WM) gives a deterministic way to combine such advice. Its guarantees hold for every finite sequence of instances and labels, including sequences chosen without any probability model. That worst-case setting is useful when the reliability of the forecasters can change or when no data-generating distribution has been justified. The paper develops WM and several variants; this mission isolates its basic mistake bound. Littlestone and Warmuth, 1994.

Setting

A finite pool has nnn members, each of which predicts either 000 or 111 on every trial. The true label on trial ttt is ρt∈{0,1}\rho_t\in\{0,1\}ρt​∈{0,1}, and member iii predicts xt,i∈{0,1}x_{t,i}\in\{0,1\}xt,i​∈{0,1}. The master prediction is λt∈{0,1}\lambda_t\in\{0,1\}λt​∈{0,1}. Pool members may themselves be learning algorithms, so their predictions may reflect all earlier labels. The mission treats their prediction vectors and the labels as arbitrary finite sequences; no independence or stationarity is assumed.

Each member begins with a strictly positive real weight w0,iw_{0,i}w0,i​. Before trial ttt, let wt,iw_{t,i}wt,i​ be its current weight. For b∈{0,1}b\in\{0,1\}b∈{0,1}, let qt,bq_{t,b}qt,b​ be the sum of weights of members predicting bbb. WM predicts the value with the larger backing total. When the two totals tie, either binary prediction is allowed. After the label is revealed, WM changes weights only if its own prediction was wrong. On such a trial, each member that predicted the wrong label has its weight multiplied by a fixed factor β\betaβ with 0≤β<10\le\beta<10≤β<1; every other member retains its weight. If WM predicted correctly, every weight stays as it was. This is the version of the algorithm stated in §1 of the paper. A footnote there says the bounds also apply to the variant that updates on every trial. Littlestone and Warmuth, 1994, p. 215.

Write Wt=∑iwt,iW_t=\sum_i w_{t,i}Wt​=∑i​wt,i​ for the total pool weight at a trial boundary. Thus W0=winitW_0=w_{\mathrm{init}}W0​=winit​ and WT=wfinW_T=w_{\mathrm{fin}}WT​=wfin​ after TTT trials. Let mmm count the trials with λt≠ρt\lambda_t\ne\rho_tλt​=ρt​. The default initial weights in the paper are all one, but its Theorem 2.1 permits arbitrary positive initial weights. Littlestone and Warmuth, 1994, pp. 220–221.

Formalization targets

The two milestones state the weight facts used immediately before and within Theorem 2.1. First, on each trial where WM errs,

Wt+1≤1+β2Wt.W_{t+1}\le \frac{1+\beta}{2}W_t.Wt+1​≤21+β​Wt​.

Across the whole sequence, with mmm master mistakes, the corresponding estimate is

WT≤W0(1+β2)m.W_T\le W_0\left(\frac{1+\beta}{2}\right)^m.WT​≤W0​(21+β​)m.

The goal is the paper's Theorem 2.1, retaining its explicit constant:

m≤log⁡(W0/WT)log⁡ ⁣(2/(1+β))when WT>0.m\le \frac{\log(W_0/W_T)} {\log\!\left(2/(1+\beta)\right)} \qquad\text{when }W_T>0.m≤log(2/(1+β))log(W0​/WT​)​when WT​>0.

The logarithm base is immaterial because the same base occurs above and below the fraction. The paper explicitly uses this convention for ratios of logarithms. The positive-final-weight condition represents the paper's statement that the displayed logarithmic bound is vacuous when all weight has vanished, which can happen for β=0\beta=0β=0. The whole-sequence weight estimate remains meaningful in that case. Littlestone and Warmuth, 1994, pp. 220–221.

Significance

The result limits the mistakes of a master predictor without assigning probabilities to the predictions or labels. It relates a visible property of the run, the reduction of total weight, to the number of master errors. Later bounds in the paper use this starting point to compare WM with an individual pool member and to analyze related algorithms; this mission fixes the initial, exact-constant result on which those comparisons rest. The β=0\beta=0β=0 case includes the paper's Halving Algorithm interpretation when initial weights are equal. Littlestone and Warmuth, 1994, pp. 215, 221–222.

The mathematical theorem is proved in the 1994 paper. The remaining task here is to represent its algorithm and finite-sequence bound in Lean and supply machine-checked proofs. A complete development would give later formalizations a reusable finite-pool voting and weight-update model, along with a checked potential estimate. The local draft statements compile; their proofs remain open. A separate, sorry-free local check constructs a run for every finite prediction and label sequence with a nonempty pool and valid weights and parameter, so the quantified run relation has witnesses.

Difficulty

The master can be wrong even when some pool members are right, and members may change their predictions over time. Counting one member's errors therefore does not directly control the master's error count. The exact contraction constant also depends on which side of a weighted vote the master chose, including the permitted tie case. When β=0\beta=0β=0, a single mistake can erase all weight backing the wrong label, so the logarithmic expression must be interpreted with care if no positive weight remains. These are features of the stated algorithm, rather than assumptions about how the sequence was generated.

Formalization scope

The formalization indexes pool members by Fin n and trials by Fin T. Booleans represent binary predictions and labels; weights and β\betaβ are real. A WM run is a relation on the full sequence of weights and master predictions, admitting every choice at a tied vote. Its update rule changes weights only after a master mistake, scales exactly the members that disagreed with the label, and leaves all other weights unchanged. Theorems require 0≤β<10\le\beta<10≤β<1 and strictly positive initial member weights. The goal additionally requires WT>0W_T>0WT​>0, while the two weight inequalities permit WT=0W_T=0WT​=0. Natural logarithms instantiate the paper's common-base logarithm convention. Finite sums and a finite mistake count match the paper's finite-sequence convention.

The statement ranges over arbitrary pool predictions and labels, so it cannot be satisfied merely by selecting an easy input sequence. The run relation allows both legal outcomes of a tie; selecting one favorable tie rule would weaken the target. The sorry-free run-existence check also rules out a vacuous theorem caused by an inconsistent update relation. The paper's update-on-every-trial variant, its member-specific corollaries, and its later algorithms are outside this mission's goal.

A completed formalization needs finite sums of real weights, cardinalities of finite sets of mistake trials, a finite induction over trial boundaries, and real logarithm inequalities. The run definition and the first two bounds can be reused in the later parts of this paper's formalization. Contributions that prove the exact stated milestones or supply supporting facts about legal runs and nonnegative weights are within scope.

Selected references

  • Nick Littlestone and Manfred K. Warmuth, The Weighted Majority Algorithm, Information and Computation 108(2), 212–261, 1994. DOI: 10.1006/inco.1994.1009.
4 thms2 active usersReviewed
🏆Completed
CombinatoricsOperations Research·Captain: mikedeng1

Flowshop and Jobshop Schedules: Complexity and Approximation 3: The Partition Job Shop on Two Machines Has a Schedule of Finish Time 5T, Preemptive or Not, Iff a Partition ExistsResearch Paper

Motivation

A job shop is the basic model of a factory floor in which every job follows its own route through the machines. Minimizing the time at which the last job is finished (the finish time, or makespan) is one of the central problems of deterministic scheduling theory, and the question of which special cases admit efficient algorithms has organized much of the field since the 1950s.

For two machines the picture is sharp. Jackson (1956) showed that a two-machine job shop in which every job has at most two operations is solved by a simple rule extending Johnson's flow-shop algorithm (Jackson, Naval Research Logistics Quarterly 3, 1956; Conway, Maxwell and Miller, Theory of Scheduling, 1967, p. 105). Once a single job may have three operations, the non-preemptive problem becomes NP-complete: Lenstra, Rinnooy Kan and Brucker showed this for n−1n-1n−1 jobs with one nonzero task each and one job with three (Annals of Discrete Mathematics 1, 1977; a 1975 Mathematisch Centrum report is the paper's reference [1]). Gonzalez and Sahni (Operations Research 26(1), 1978) extended this boundary to preemptive schedules, in which a task may be interrupted and resumed later: even then the two-machine problem is NP-complete, already when only two jobs have three nonzero tasks. This mission formalizes that reduction, Lemma 5 together with Corollary 2 of their paper.

Timeline:

  • 1956: Jackson, two-machine job shop with at most two operations per job, solved in O(nlog⁡n)O(n\log n)O(nlogn).
  • 1975/1977: Lenstra, Rinnooy Kan and Brucker, the non-preemptive two-machine job shop NP-complete with n−1n-1n−1 one-task jobs and one three-task job.
  • 1976: Garey, Johnson and Sethi, the non-preemptive two-machine job shop NP-complete even when problem size is measured by the sum of the task lengths (Mathematics of Operations Research 1, 1976).
  • 1978: Gonzalez and Sahni, the preemptive two-machine job shop NP-complete (Lemmas 5 and 6), and the non-preemptive case again by the same reduction (Corollary 2).

Setting

A job shop has processors P1,…,PmP_1, \dots, P_mP1​,…,Pm​ and jobs 1,…,n1, \dots, n1,…,n. Job iii is a finite sequence of tasks; task jjj of job iii must be processed on a given processor kkk for tk,i,j≥0t_{k,i,j} \ge 0tk,i,j​≥0 time units, and for every job, task j≥2j \ge 2j≥2 can begin only after task j−1j-1j−1 has been completed. Schedules start at time 000. A preemptive schedule assigns to every task a finite set of time intervals [s,f)[s, f)[s,f) on its processor, of total length tk,i,jt_{k,i,j}tk,i,j​, such that intervals on the same processor do not overlap and every interval of task jjj begins after task j−1j-1j−1 of the same job is completed. A non-preemptive schedule processes each task in a single interval. If fi(S)f_i(S)fi​(S) is the time at which job iii is completed, the finish time is FT(S)=max⁡ifi(S)\mathrm{FT}(S) = \max_i f_i(S)FT(S)=maxi​fi​(S).

PARTITION: a multiset {a1,…,an}\{a_1, \dots, a_n\}{a1​,…,an​} of nonnegative integers has a partition if some index set uuu satisfies ∑i∈uai=12∑i=1nai\sum_{i \in u} a_i = \tfrac12 \sum_{i=1}^n a_i∑i∈u​ai​=21​∑i=1n​ai​.

From a1,…,ana_1, \dots, a_na1​,…,an​, with T=∑iaiT = \sum_i a_iT=∑i​ai​, the paper builds the two-processor job shop JS\mathrm{JS}JS with n+2n+2n+2 jobs:

  • job i≤ni \le ni≤n: tasks (P2,ai)(P_2, a_i)(P2​,ai​), (P1,ai)(P_1, a_i)(P1​,ai​);
  • job n+1n+1n+1: tasks (P1,T/2)(P_1, T/2)(P1​,T/2), (P2,T/2)(P_2, T/2)(P2​,T/2), (P1,3T)(P_1, 3T)(P1​,3T);
  • job n+2n+2n+2: tasks (P2,3T)(P_2, 3T)(P2​,3T), (P1,T/2)(P_1, T/2)(P1​,T/2), (P2,T/2)(P_2, T/2)(P2​,T/2).

Each processor carries load exactly 5T5T5T. In Lean, the instance is JS a : JobShopLTAS.Core.Instance 2 (n + 2), a schedule is S : Schedule (JS a) (a finite set of pieces), and the predicates are S.IsPreemptive, S.IsNonPreemptive and S.FinishedBy (5 * T a).

Formalization targets

Goal: Lemma 5 and Corollary 2

For every nnn and every a:Fin n→Na : \mathrm{Fin}\,n \to \mathbb Na:Finn→N,

(∃ S preemptive, FT(S)≤5T)  ⟺  Partition(a)and(∃ S non-preemptive, FT(S)≤5T)  ⟺  Partition(a).\bigl(\exists\, S \text{ preemptive},\ \mathrm{FT}(S) \le 5T\bigr) \iff \mathrm{Partition}(a) \quad\text{and}\quad \bigl(\exists\, S \text{ non-preemptive},\ \mathrm{FT}(S) \le 5T\bigr) \iff \mathrm{Partition}(a).(∃S preemptive, FT(S)≤5T)⟺Partition(a)and(∃S non-preemptive, FT(S)≤5T)⟺Partition(a).

Milestones

  1. Lemma 5(a): a partition yields a non-preemptive schedule of finish time exactly 5T5T5T (the paper's Figure 3).
  2. Observations (i)–(ii) in the proof of Lemma 5(b): in any preemptive schedule with FT≤5T\mathrm{FT} \le 5TFT≤5T, task t2,n+1,2t_{2,n+1,2}t2,n+1,2​ is completed by 2T2T2T and t2,n+2,1t_{2,n+2,1}t2,n+2,1​ by 4T4T4T; no part of t1,n+1,3t_{1,n+1,3}t1,n+1,3​ runs before TTT and no part of t1,n+2,2t_{1,n+2,2}t1,n+2,2​ before 3T3T3T.
  3. Lemma 5(b): without a partition, every preemptive schedule has FT>5T\mathrm{FT} > 5TFT>5T.
  4. Lemma 5: the preemptive equivalence.
  5. Corollary 2: the non-preemptive equivalence.

Significance

The result places the boundary of tractability for two-machine job shops exactly: at most two operations per job is solvable in O(nlog⁡n)O(n\log n)O(nlogn), while two jobs with three operations make the problem NP-complete, and allowing preemption does not help. The same instance serves both schedule types, because its optimum is 5T5T5T in either model exactly when a partition exists.

The theorem is classical and fully proved on paper; no machine-checked proof is known to exist. Formalizing it requires a precise model of preemptive schedules, which the paper treats informally, and makes explicit an argument (the "no idle time" step of Lemma 5(b)) that the paper compresses into a few sentences. The schedule model built here is shared with the other job-shop missions of this series.

Difficulty

Direction (a) is a concrete schedule and is bookkeeping. Direction (b) is the substance. The tempting argument "each processor has load 5T5T5T, so a schedule of finish time 5T5T5T has no idle time, hence some set of short jobs fills exactly [0,T/2][0, T/2][0,T/2] on P2P_2P2​" is incomplete for preemptive schedules: the short jobs may be split into many pieces spread over the whole horizon, and UUU, the set of short jobs that touch P1P_1P1​ during [0,T][0, T][0,T], is defined by pieces rather than by whole tasks. Making the counting argument rigorous requires measuring idle time on each processor across arbitrary finite unions of intervals and tying the amount of processing done on P1P_1P1​ before TTT to the completed first tasks on P2P_2P2​.

Formalization scope

  • Processing times are real numbers; the PARTITION data are natural numbers cast to R\mathbb RR; TTT is the real sum. Processors are Fin 2 with P1=0P_1 = 0P1​=0, P2=1P_2 = 1P2​=1; jobs and tasks are 0-based, so the paper's job n+1n+1n+1 is job n and job n+2n+2n+2 is job n + 1.
  • Job-shop data reuse the published JobShopLTAS.Core.Instance. Schedules are finite sets of pieces (task, start, end) with positive length, following the paper's footnote 1 (p. 40). A task of length zero has no pieces and is completed when its predecessor is; it never blocks a processor.
  • A non-preemptive schedule is a preemptive one with at most one piece per task. "Finish time ≤τ\le \tau≤τ" is ∀ j, S.jobFinish j ≤ τ; "finish time >5T> 5T>5T" is the existence of a job finishing after 5T5T5T; "finish time 5T5T5T" in Lemma 5(a) is ≤5T\le 5T≤5T together with a job finishing at exactly 5T5T5T.
  • Complexity wording not formalized. "Partition α\alphaα preemptive JOFT" and "Partition α\alphaα nonpreemptive JOFT" (polynomial reducibility), "NP-complete", and Lemma 6 ("JOFT is in NP") are not stated. What is stated is the equivalence that the paper's proofs establish for the instance they construct, with the explicit constant τ=5T\tau = 5Tτ=5T.
  • The PARTITION condition is written 2∑i∈uai=∑iai2\sum_{i\in u} a_i = \sum_i a_i2∑i∈u​ai​=∑i​ai​ in N\mathbb NN, avoiding truncated division.
  • A trivializing formalization is ruled out: the schedule notion requires every task to receive its full processing time, so the empty schedule is feasible only when T=0T = 0T=0 (and then the empty index set is a partition), and the finish-time bound is over every job, so no statement holds by an unattained supremum or a default value.
  • Welcome contributions: a proof of Lemma 5(a) by an explicit piece schedule; infrastructure for measuring busy and idle time of a processor in a finite piece schedule, reusable for Lemma 7 (mission 4) and the preemptive flow-shop missions; the proof of Lemma 5(b).

Selected references

  • T. Gonzalez, S. Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1), 36–52, 1978. https://doi.org/10.1287/opre.26.1.36
  • J. K. Lenstra, A. H. G. Rinnooy Kan, P. Brucker, Complexity of Machine Scheduling Problems, Annals of Discrete Mathematics 1, 343–362, 1977. https://doi.org/10.1016/S0167-5060(08)70743-X
  • M. R. Garey, D. S. Johnson, R. Sethi, Complexity of Flow Shop and Job Shop Scheduling, Mathematics of Operations Research 1(2), 117–129, 1976. https://doi.org/10.1287/moor.1.2.117
  • J. R. Jackson, An Extension of Johnson's Results on Job Lot Scheduling, Naval Research Logistics Quarterly 3(3), 201–203, 1956. https://doi.org/10.1002/nav.3800030307
  • R. W. Conway, W. L. Maxwell, L. W. Miller, Theory of Scheduling, Addison-Wesley, 1967.
11 thms2 active usersReviewed
🏆Completed
CombinatoricsGraph Theory·Captain: mikedeng1

Multicommodity Max-Flow Min-Cut Theorems and Their Use in Designing Approximation Algorithms V: On a 3-Regular c-Expander the Uniform Max-Flow Is at Most 6𝒮/(c(⌊log n⌋ − 2))Research Paper

Motivation

A multicommodity flow problem asks to route many source–sink demands through one capacitated network at the same time. Its min-cut (sparsest cut) is the smallest ratio, over all cuts, of the capacity crossing the cut to the demand separated by it. Routing is always limited by every cut, so the max-flow never exceeds the min-cut. For a single commodity the two are equal (Ford–Fulkerson); for many commodities they are not, and the size of the gap governs a large family of approximation algorithms for graph partitioning, layout and routing problems.

Leighton and Rao (J. ACM 46 (1999), extended abstract FOCS 1988) proved that for uniform problems, where every pair of nodes demands one unit, the gap is at most O(log⁡n)O(\log n)O(logn) (their Theorem 2). This mission formalizes the other half: Section 2.1 of the paper, A bad example, which shows that the log⁡n\log nlogn is necessary. On a 3-regular expander graph the max-flow is a Θ(log⁡n)\Theta(\log n)Θ(logn) factor smaller than the min-cut, so Theorem 2 cannot be improved beyond the constant.

Timeline. Ford and Fulkerson (1956) and Elias–Feinstein–Shannon (1956): single-commodity max-flow equals min-cut. Hu (1963): equality for two commodities. Leighton and Rao (1988, journal 1999): uniform and product problems have an O(log⁡n)O(\log n)O(logn) gap, and expanders show it is tight. Klein, Agrawal, Ravi and Rao (1990) and later Linial–London–Rabinovich (Combinatorica 1995) and Aumann–Rabani (1998): an O(log⁡k)O(\log k)O(logk) gap for general demands with kkk commodities, tight by the same expander example.

Setting

Let VVV be a finite set of nnn nodes. A network assigns a capacity C(u,v)≥0C(u,v)\ge0C(u,v)≥0 to every pair, symmetric and zero on the diagonal. For U⊆VU\subseteq VU⊆V with complement Uˉ\bar UUˉ, the cut capacity C(U,Uˉ)C(U,\bar U)C(U,Uˉ) is the total capacity of the pairs with one end in UUU and the other in Uˉ\bar UUˉ.

In the uniform multicommodity flow problem (UMFP) every pair of distinct nodes is a commodity with unit demand. Its max-flow fff is the largest fraction such that fff units of every commodity can be routed simultaneously without exceeding any capacity (concurrent flow). Its min-cut is

S=min⁡∅≠U⊊VC(U,Uˉ)∣U∣ ∣Uˉ∣.\mathcal S=\min_{\emptyset\ne U\subsetneq V}\frac{C(U,\bar U)}{|U|\,|\bar U|}.S=∅=U⊊Vmin​∣U∣∣Uˉ∣C(U,Uˉ)​.

Section 2.1 takes a 3-regular nnn-node graph GGG with unit edge capacities, so that C(U,Uˉ)=∣⟨U,Uˉ⟩∣C(U,\bar U)=|\langle U,\bar U\rangle|C(U,Uˉ)=∣⟨U,Uˉ⟩∣ is the number of edges between UUU and Uˉ\bar UUˉ, and assumes that GGG is a ccc-edge-expander:

∣⟨U,Uˉ⟩∣ ≥ c min⁡{∣U∣,∣Uˉ∣}for all U⊆V,|\langle U,\bar U\rangle|\ \ge\ c\,\min\{|U|,|\bar U|\}\qquad\text{for all }U\subseteq V,∣⟨U,Uˉ⟩∣ ≥ cmin{∣U∣,∣Uˉ∣}for all U⊆V,

for a constant c>0c>0c>0. Families of such graphs exist for a sufficiently small ccc (Margulis 1973; a random 3-regular graph has the property with high probability). Throughout, log⁡\loglog is log⁡2\log_2log2​.

Formalization targets

Goal: the gap on an expander

For a 3-regular ccc-edge-expander with unit capacities and n≥8n\ge 8n≥8,

f ≤ 6 Sc (⌊log⁡n⌋−2).f\ \le\ \frac{6\,\mathcal S}{c\,\bigl(\lfloor\log n\rfloor-2\bigr)} .f ≤ c(⌊logn⌋−2)6S​.

This is the final display of §2.1 (pp. 794–795), with the floor that the argument actually supports (see Formalization scope). It leaves the expander family unspecified: it holds for every graph with the two properties.

Milestones, in the order the argument uses them

  1. S≥c/(n−1)\mathcal S\ge c/(n-1)S≥c/(n−1) for the expander (p. 794).
  2. In a 3-regular graph, at most n/2n/2n/2 nodes lie within distance ⌊log⁡n⌋−3\lfloor\log n\rfloor-3⌊logn⌋−3 of any node.
  3. Hence at least half of the source–sink pairs are at distance at least ⌊log⁡n⌋−2\lfloor\log n\rfloor-2⌊logn⌋−2.
  4. A uniform flow of fraction fff uses capacity at least 12(n2)f(⌊log⁡n⌋−2)\tfrac12\binom n2 f(\lfloor\log n\rfloor-2)21​(2n​)f(⌊logn⌋−2), and the total capacity is 3n/23n/23n/2.
  5. Hence f≤3n/((n2)(⌊log⁡n⌋−2))=6/((n−1)(⌊log⁡n⌋−2))f\le 3n/\bigl(\binom n2(\lfloor\log n\rfloor-2)\bigr)=6/\bigl((n-1)(\lfloor\log n\rfloor-2)\bigr)f≤3n/((2n​)(⌊logn⌋−2))=6/((n−1)(⌊logn⌋−2)).

Companions: Theorem 1

Theorem 1 (p. 795) states that for any nnn there is an nnn-node UMFP with f≤O(S/log⁡n)f\le O(\mathcal S/\log n)f≤O(S/logn). It is stated twice: conditionally on a family of 3-regular ccc-expanders (the form §2.1 proves), and unconditionally, with one constant KKK for all n≥2n\ge2n≥2.

Significance

The result shows that the O(log⁡n)O(\log n)O(logn) max-flow min-cut gap of Leighton and Rao's Theorem 2 is tight up to the constant, and, through the same example, that the O(log⁡k)O(\log k)O(logk) bound for general demands is tight. Every approximation algorithm that rounds a multicommodity flow, or its dual, to a cut loses a Θ(log⁡n)\Theta(\log n)Θ(logn) factor in the worst case for this reason; improving on it, as Arora, Rao and Vazirani did (J. ACM 2009) with an O(log⁡n)O(\sqrt{\log n})O(logn​) approximation for sparsest cut, requires a stronger relaxation than the flow LP.

The result is classical and proved. To our knowledge it has no machine-checked proof. Formalizing it requires the concurrent-flow LP, the uniform sparsest cut, graph distance balls in bounded-degree graphs and a counting argument that converts path lengths into capacity usage; each of these is reusable. The unconditional Theorem 1 additionally needs the existence of bounded-degree expanders on every number of nodes, which is a substantial formalization project in its own right.

Difficulty

The min-cut bound and the ball bound are elementary. The central step is milestone 4: turning "the shortest path of a commodity has at least ℓ\ellℓ edges" into "the commodity uses at least fℓf\ellfℓ units of capacity". In an arc-flow formulation a commodity is a conservation-respecting function on arcs, not a set of paths, so the step needs either a path decomposition of each commodity's flow or a weak-duality argument with unit edge lengths. The obvious attempt, summing the conservation equations directly, gives only the net flow across one cut and loses the factor ℓ\ellℓ.

The unconditional Theorem 1 is hard for a different reason: the paper cites the existence of 3-regular expanders and does not prove it, and the theorem asks for every nnn, including odd nnn, where no 3-regular graph exists.

Formalization scope

Nodes are a Fintype VVV with decidable equality and n=∣V∣n=|V|n=∣V∣. A network is a symmetric nonnegative real capacity function with zero diagonal; the unit-capacity network of a simple graph GGG has C(u,v)=1C(u,v)=1C(u,v)=1 on edges and 000 elsewhere. Commodities are ordered pairs (s,t)(s,t)(s,t), s≠ts\ne ts=t, each with demand 12\tfrac1221​ (the paper's footnote 2), so each unordered pair carries one unit; a flow is a nonnegative arc flow per commodity, and both directions of an edge share its capacity. The max-flow is the supremum of feasible fractions. The min-cut ranges over nonempty proper UUU only: at U=∅U=\emptysetU=∅ or VVV the ratio is 0/00/00/0, which Lean reads as 000 and which would make S=0\mathcal S=0S=0.

Conventions and added hypotheses:

  • The floor. The page writes log⁡n−2\log n-2logn−2. Its argument shows that far pairs have distance at least ⌊log⁡n⌋−2\lfloor\log n\rfloor-2⌊logn⌋−2, which differs from log⁡n−2\log n-2logn−2 for non-integer log⁡n\log nlogn. The goal and milestones state ⌊log⁡n⌋−2\lfloor\log n\rfloor-2⌊logn⌋−2 (Nat.log 2 n), a different constant in the same Θ(log⁡n)\Theta(\log n)Θ(logn).
  • n≥8n\ge 8n≥8 makes ⌊log⁡n⌋−2≥1\lfloor\log n\rfloor-2\ge1⌊logn⌋−2≥1, so the bound divides by a positive number.
  • Graph distance is the extended distance, ∞\infty∞ between components, never Lean's junk value 000.
  • Regularity is SimpleGraph.IsRegularOfDegree 3.
  • Theorem 1 requires the network to be connected (the paper's standing assumption, p. 789); a disconnected network has f=S=0f=\mathcal S=0f=S=0 and would make the statement empty. Its constant is quantified before nnn.
  • Polynomial-time claims are not formalized.

The hypotheses of the goal are satisfiable: the 3-cube Q3Q_3Q3​ (n=8n=8n=8) is 3-regular and a 111-edge-expander. Contributions welcome: the arc-flow path-length lemma, the ball bound for bounded-degree graphs, and an existence theorem for 3-regular expanders.

Selected references

  • T. Leighton and S. Rao, Multicommodity max-flow min-cut theorems and their use in designing approximation algorithms, J. ACM 46(6):787–832, 1999. https://doi.org/10.1145/331524.331526
  • G. A. Margulis, Explicit constructions of concentrators, Problems of Information Transmission 9(4):325–332, 1973.
  • N. Linial, E. London and Y. Rabinovich, The geometry of graphs and some of its algorithmic applications, Combinatorica 15(2):215–245, 1995. https://doi.org/10.1007/BF01200757
  • S. Arora, S. Rao and U. Vazirani, Expander flows, geometric embeddings and graph partitioning, J. ACM 56(2):5, 2009. https://doi.org/10.1145/1502793.1502794
7 thms2 active usersReviewed
🏆Completed
CombinatoricsGraph Theory·Captain: mikedeng1

A Theorem on Boolean Matrices: Warshall's Construction M* Equals the Boolean Sum M ∨ M² ∨ ⋯ ∨ Mᵈ of the Boolean Powers of MResearch Paper

Motivation

A finite directed graph on ddd vertices is recorded by its adjacency matrix, a d×dd \times dd×d array of zeros and ones. Many questions about the graph are questions about reachability: can vertex jjj be reached from vertex iii by following one or more edges? In the late 1950s this question arose in the analysis of programs. Prosser (Applications of Boolean matrices to the analysis of flow diagrams, 1959) represented the flow diagram of a program by a boolean matrix and read off properties such as which blocks can follow which; Marimont (A new method of checking the consistency of precedence matrices, J. ACM 1959) used the same matrices to check precedence relations for consistency.

In both works the reachability matrix is described as a boolean sum of boolean powers of the adjacency matrix. Computed that way, it costs ddd boolean matrix products, that is on the order of d3d^3d3 operations per product. Stephen Warshall's two-page note (A theorem on Boolean matrices, J. ACM 9 (1962) 11–12) proves that a much shorter procedure, ddd passes of row updates performed in place, gives the same matrix. The same procedure was published in the same year by Floyd as Algorithm 96: Ancestor (Comm. ACM 5 (1962) 344), and its weighted version is Floyd's Algorithm 97: Shortest Path. The procedure is now taught as the Floyd–Warshall or Roy–Warshall algorithm.

Timeline. 1959: Prosser and Marimont describe reachability as a sum of boolean powers. 1959: Roy publishes the same closure construction in French (C. R. Acad. Sci. Paris 249). 1962: Warshall's note proves the in-place construction correct; Floyd's Algorithm 96 publishes it as code, and Algorithm 97 extends it to shortest paths.

Setting

Fix a natural number ddd and let M=(mij)M = (m_{ij})M=(mij​) be a d×dd \times dd×d matrix each of whose entries is 000 or 111.

  • The boolean product of two such matrices AAA and BBB is the matrix A∧BA \wedge BA∧B with (A∧B)ij=⋁k(aik∧bkj)(A \wedge B)_{ij} = \bigvee_k (a_{ik} \wedge b_{kj})(A∧B)ij​=⋁k​(aik​∧bkj​): the entry is 111 when some index kkk has aik=bkj=1a_{ik} = b_{kj} = 1aik​=bkj​=1.
  • The boolean sum A∨BA \vee BA∨B is the entrywise disjunction, (A∨B)ij=aij∨bij(A \vee B)_{ij} = a_{ij} \vee b_{ij}(A∨B)ij​=aij​∨bij​.
  • The boolean powers are M1=MM^1 = MM1=M and Mp+1=Mp∧MM^{p+1} = M^p \wedge MMp+1=Mp∧M.
  • The introduction's matrix is the power sum
M′  =  ⋁p=1dMp.M' \;=\; \bigvee_{p=1}^{d} M^p .M′=p=1⋁d​Mp.
  • The THEOREM defines M′M'M′ instead by chains: mij′=1m'_{ij} = 1mij′​=1 if and only if either mij=1m_{ij} = 1mij​=1 or there are indices k1,…,knk_1, \dots, k_nk1​,…,kn​ with mik1=mk1k2=⋯=mknj=1m_{ik_1} = m_{k_1k_2} = \cdots = m_{k_nj} = 1mik1​​=mk1​k2​​=⋯=mkn​j​=1. Footnote 2 states that the two definitions agree.
  • Warshall's construction M∗M^*M∗: set M∗=MM^* = MM∗=M; for i=1,…,di = 1, \dots, di=1,…,d in turn, for every row jjj with mji∗=1m^*_{ji} = 1mji∗​=1 and every column kkk, set mjk∗=mjk∗∨mik∗m^*_{jk} = m^*_{jk} \vee m^*_{ik}mjk∗​=mjk∗​∨mik∗​. Entries are overwritten during a pass and later steps of the same pass read the new values.
  • Footnote 3 gives a recursive version: (mij)0=mij(m_{ij})_0 = m_{ij}(mij​)0​=mij​ and (mij)n+1=(mij)n∨((mi,n+1)n∧(mn+1,j)n)(m_{ij})_{n+1} = (m_{ij})_n \vee \bigl((m_{i,n+1})_n \wedge (m_{n+1,j})_n\bigr)(mij​)n+1​=(mij​)n​∨((mi,n+1​)n​∧(mn+1,j​)n​), and asserts mij∗=(mij)dm^*_{ij} = (m_{ij})_dmij∗​=(mij​)d​.

In Lean the matrix is M : Fin d → Fin d → Bool. The power sum is powerSum M, the chain relation ChainRel M i j, the recursion warshallRec M n, all in the namespace WarshallBool.Closure. The construction M∗M^*M∗ is the published FloydAlgorithms.ShortestPath.algorithm96 M.

Formalization targets

Goal: the construction computes the power sum

M∗  =  ⋁p=1dMpfor every d and every d×d 0-1 matrix M.M^* \;=\; \bigvee_{p=1}^{d} M^p \qquad \text{for every } d \text{ and every } d \times d \text{ 0-1 matrix } M .M∗=p=1⋁d​Mpfor every d and every d×d 0-1 matrix M.

This is the transformation the introduction asks for, combined with the THEOREM's assertion M∗=M′M^* = M'M∗=M′ and footnote 2. The goal has no hypothesis beyond the shape of MMM.

Milestone 1 (Proved, referenced): the THEOREM

mij∗=1  ⟺  mij=1 or mik1=⋯=mknj=1 for some k1,…,kn.m^*_{ij} = 1 \iff m_{ij} = 1 \text{ or } m_{ik_1} = \cdots = m_{k_nj} = 1 \text{ for some } k_1, \dots, k_n .mij∗​=1⟺mij​=1 or mik1​​=⋯=mkn​j​=1 for some k1​,…,kn​.

It is already on the platform as FloydAlgorithms.ShortestPath.algorithm96_eq_transGen, stated with Mathlib's transitive closure Relation.TransGen, and it is not posed again.

Milestone 2: footnote 2

mij=1 or a chain i→k1→⋯→kn→j of 1 entries  ⟺  (⋁p=1dMp)ij=1.m_{ij} = 1 \text{ or a chain } i \to k_1 \to \cdots \to k_n \to j \text{ of 1 entries} \iff \Bigl(\bigvee_{p=1}^{d} M^p\Bigr)_{ij} = 1 .mij​=1 or a chain i→k1​→⋯→kn​→j of 1 entries⟺(p=1⋁d​Mp)ij​=1.

Companion: footnote 3

M∗  =  ((mij)d)i,j.M^* \;=\; \bigl((m_{ij})_d\bigr)_{i,j} .M∗=((mij​)d​)i,j​.

This is not a milestone of the goal; it identifies the in-place construction with its stage-by-stage recursion.

Significance

The result. The theorem says that reachability in a directed graph on ddd vertices, defined through matrix powers, can be computed by ddd passes of in-place row operations, on the order of d2d^2d2 row updates instead of ddd full boolean matrix products. The same scheme, with (min⁡,+)(\min, +)(min,+) in place of (∨,∧)(\vee, \wedge)(∨,∧), is the Floyd–Warshall shortest-path algorithm; with other semirings it computes regular expressions of finite automata (Kleene, McNaughton–Yamada) and path problems in general. Footnote 3's recursion is the form in which the algorithm is usually proved correct today, and its equivalence with the in-place version is what justifies running it without a second copy of the matrix.

Formalizing it. The chain form of the THEOREM is already machine-checked on Prove2Me (algorithm96_eq_transGen). What this mission adds is the statement in the paper's own terms: the introduction's power sum ⋁p=1dMp\bigvee_{p=1}^d M^p⋁p=1d​Mp, footnote 2's equivalence between powers and chains, which requires that chains can be shortened to length at most ddd, and footnote 3's in-place versus recursive equivalence. None of these three is on the platform. The paper itself proves only the THEOREM; footnotes 2 and 3 are stated without proof.

Difficulty

Footnote 2 calls the equivalence "trivial", but one direction needs a pigeonhole argument: a chain i→k1→⋯→kn→ji \to k_1 \to \cdots \to k_n \to ji→k1​→⋯→kn​→j of arbitrary length witnesses some power Mn+1M^{n+1}Mn+1, and the power sum stops at MdM^dMd. A chain with repeated indices has to be shortened, and the shortening must keep at least one step, since there is no reflexive part (mii′=1m'_{ii} = 1mii′​=1 only through a cycle). For a ddd-cycle the diagonal entries appear only in MdM^dMd, so the range 1..d1..d1..d is exact.

Footnote 3 compares two computations that read different data. The construction overwrites entries during a pass, and later steps of the same pass read the overwritten values; the recursion reads only the previous stage. The two agree only because of what a pass does and does not overwrite, and the published algorithm96 is three nested left folds over List.finRange, so the comparison has to be made against that concrete loop structure rather than an idealized simultaneous update.

Formalization scope

  • Matrices are Fin d → Fin d → Bool, with 111 as true. Indices are 0,…,d−10, \dots, d-10,…,d−1 instead of the page's 1,…,d1, \dots, d1,…,d; the pivot of pass iii (1-based) is the 0-based index i−1i-1i−1.
  • d=0d = 0d=0 is allowed; all statements are then trivially true, as on the page.
  • The boolean product boolProd A B i j is decide (∃ k, A i k = true ∧ B k j = true). Mathlib's matrix product on Matrix (Fin d) (Fin d) Bool is not the boolean product: Bool is a boolean ring there, its addition is exclusive or, and that product counts walks modulo 2. A formalization through * or ^ on Matrix _ _ Bool states a different, false theorem and is ruled out.
  • boolPow M p is the page's MpM^pMp for p≥1p \ge 1p≥1; the base boolPow M 0 is the identity matrix, which is not on the page and does not enter the sum. powerSum M i j holds iff boolPow M p i j for some p∈{1,…,d}p \in \{1, \dots, d\}p∈{1,…,d}. No reflexive closure is included anywhere.
  • ChainRel M i j is the existence of a list [k1,…,kn][k_1, \dots, k_n][k1​,…,kn​] (possibly empty) making i,k1,…,kn,ji, k_1, \dots, k_n, ji,k1​,…,kn​,j a List.IsChain of true entries.
  • warshallRec M n uses the 0-based pivot nnn at stage n+1n+1n+1 and is constant after stage ddd, which footnote 3 never uses.
  • M∗M^*M∗ is the published algorithm96, which fixes the inner loops over rows and columns in ascending order; Warshall leaves that order open, and it does not affect the result.
  • The goal must not be stated through TransGen, ChainRel or warshallRec, and powerSum is defined from boolPow, not from the closure or the algorithm.

Reusable beyond this mission: the boolean matrix product and powers, the power-sum characterization of the transitive closure of a relation on Fin d (footnote 2), and the in-place/recursive equivalence (footnote 3), which carries over to Floyd's Algorithm 97. Proofs of milestone 2 and of the companion are welcome independently of the goal.

Selected references

  • S. Warshall, A theorem on Boolean matrices, J. ACM 9(1) (1962) 11–12. https://doi.org/10.1145/321105.321107
  • R. W. Floyd, Algorithm 96: Ancestor, Comm. ACM 5(6) (1962) 344–345. https://doi.org/10.1145/367766.368166
  • R. W. Floyd, Algorithm 97: Shortest path, Comm. ACM 5(6) (1962) 345. https://doi.org/10.1145/367766.368168
  • R. T. Prosser, Applications of Boolean matrices to the analysis of flow diagrams, Proc. Eastern Joint Computer Conference (1959) 133–138. https://doi.org/10.1145/1460299.1460314
  • R. B. Marimont, A new method of checking the consistency of precedence matrices, J. ACM 6(2) (1959) 164–171. https://doi.org/10.1145/320964.320975
  • B. Roy, Transitivité et connexité, C. R. Acad. Sci. Paris 249 (1959) 216–218.
5 thms2 active usersReviewed
🏆Completed
Formal Verification·Captain: mikedeng1

Reaching Agreement in the Presence of Faults 3: With Authenticated Messages, the S_pq Procedure Assures Interactive Consistency for m Faults for Every n ≥ mResearch Paper

Motivation

Processors in a distributed system may hold separate readings of a sensor, clock, or diagnostic result while some processors give misleading reports. The aim of interactive consistency is for every functioning processor to compute the same vector of reported values and to put each functioning processor's actual private value in its corresponding position. A shared vector can then be used for a common decision. Pease, Shostak, and Lamport formulated this problem for isolated processors communicating by two-party messages; their paper discusses clock synchronization, input stabilization, and diagnostic tests as concrete applications Pease–Shostak–Lamport 1980.

In the paper's oral-message model, faulty processors can invent reports about values they received from others. The other two missions in this series formalize the recursive majority procedure for n≥3m+1n\ge 3m+1n≥3m+1 and the matching impossibility result below that bound. Section 5 changes the communication assumption: a faulty processor may refuse to pass on a received value but cannot pass on an altered value as if it came from its original sender. Under that assumption, the authors give a procedure for every n≥mn\ge mn≥m, including configurations outside the oral-message threshold Pease–Shostak–Lamport 1980, §§3–5.

Setting

Let PPP be a finite set of nnn processors and VVV a type of private values. Each processor q∈Pq\in Pq∈P has a value σ(q)∈V\sigma(q)\in Vσ(q)∈V. A scenario σ\sigmaσ records the values reported along chains of processors. A string p1p2⋯prp_1p_2\cdots p_rp1​p2​⋯pr​ is read from receiver to originator: p1p_1p1​ receives a report ultimately attributed to prp_rpr​. A recorded value may be NIL, meaning that no authenticated value is available. The view available to receiver ppp is its ppp-scenario, the restriction w↦σ(pw)w\mapsto\sigma(pw)w↦σ(pw); it contains no report that begins with a different receiver.

Choose a set N⊆PN\subseteq PN⊆P of nonfaulty processors. At most mmm processors may be faulty, expressed as ∣P∣≤∣N∣+m|P|\le |N|+m∣P∣≤∣N∣+m. An authenticated scenario consistent with NNN obeys two conditions whenever the displayed strings are in the (m+1)(m+1)(m+1)-level scenario. If p∈Np\in Np∈N and q∈Pq\in Pq∈P, the report made by nonfaulty relay ppp is truthful: σ(qpw)=σ(pw)\sigma(qpw)=\sigma(pw)σ(qpw)=σ(pw). For any prefix w′w'w′, a chain passing through nonfaulty ppp carries either the value at ppp or NIL: σ(w′pw)∈{σ(pw),NIL}\sigma(w'pw)\in\{\sigma(pw),\mathrm{NIL}\}σ(w′pw)∈{σ(pw),NIL}. The second condition allows omission by later relays while excluding a changed value falsely attributed to ppp Pease–Shostak–Lamport 1980, p. 233.

For each receiver ppp and originator qqq, the procedure forms SpqS_{pq}Spq​, the set of all non-NIL values in ppp's view on strings pwqpwqpwq. The intermediate string www has at most mmm distinct letters, all in P∖{p,q}P\setminus\{p,q\}P∖{p,q}. Receiver ppp records the sole value in SpqS_{pq}Spq​ when this set is a singleton; otherwise it records NIL. The resulting entries, one for each q∈Pq\in Pq∈P, form ppp's proposed consistency vector Pease–Shostak–Lamport 1980, p. 233.

Formalization targets

The first milestone covers a nonfaulty originator qqq: every nonfaulty receiver ppp sees exactly its true value. The second covers a faulty originator: the set of non-NIL values seen by one nonfaulty receiver is contained in the set seen by another. The same statement with the receivers exchanged gives equality of their sets.

The goal is the procedure's full interactive-consistency guarantee, for every choice of NNN and every authenticated scenario satisfying the conditions above:

Rp(q)=σ(q)(p,q∈N),Rp(r)=Rp′(r)(p,p′∈N, r∈P).\begin{aligned} R_p(q)&=\sigma(q) &&(p,q\in N),\\ R_p(r)&=R_{p'}(r) &&(p,p'\in N,\ r\in P). \end{aligned}Rp​(q)Rp​(r)​=σ(q)=Rp′​(r)​​(p,q∈N),(p,p′∈N, r∈P).​

Here Rp(r)R_p(r)Rp​(r) is the optional value recorded by processor ppp for processor rrr. Both clauses matter: agreement alone could be achieved by always recording NIL, while correct nonfaulty entries alone would leave faulty entries inconsistent.

Significance

The result identifies an exact communication assumption under which the paper's 3m+13m+13m+1 oral-message bound no longer governs the procedure. Even if a faulty originator gives conflicting values, nonfaulty receivers finish with identical entries for that originator; if an originator is nonfaulty, they retain its actual value. The paper describes authenticators as a practical approximation to the assumption, but the guarantee here is a mathematical statement about scenarios satisfying its two conditions, not a probability claim about a cryptographic implementation Pease–Shostak–Lamport 1980, §5.

Formalizing this result supplies precise interfaces for authenticated scenario consistency, local views, the set SpqS_{pq}Spq​, and the recording rule. The paper proves the result on pp. 233–234; this mission asks for a machine-checked proof of those statements in Lean. The scenario and local-view definitions can support later formalizations of message-passing protocols with truthful or omissible relays. Contributions that establish the two source milestones and the final guarantee, or develop reusable list and finite-set facts needed by them, are within scope.

Difficulty

The case of a faulty originator is the central difficulty. Its private value has no required relationship to what different nonfaulty receivers hear, so simply asserting that every receiver obtains the same direct report is unjustified. A faulty relay may also omit a report, which makes equality of raw scenario entries too strong. The target must compare sets of non-NIL values obtained along admissible relay chains. At the longest allowed chain, the length bound prevents adding another relay, and the number of faulty processors is needed to establish that an admissible nonfaulty relay occurs in the chain Pease–Shostak–Lamport 1980, p. 234.

Formalization scope

Lean represents processors by a finite set P : Finset α, values by a type V, strings by List α, and NIL by none : Option V. A scenario is a total function from strings to optional values. Only strings over PPP of length at most m+2m+2m+2 are constrained by authenticated consistency, matching the (m+1)(m+1)(m+1)-level scenario that the procedure reads. A single-letter string has a non-NIL private value for every processor in PPP. Conditions (i) and (ii) constrain nonfaulty relays only; condition (ii) allows either the original value or NIL for every prefix over PPP, including an empty prefix.

The procedure is applied only to ppp's view w↦σ(pw)w\mapsto\sigma(pw)w↦σ(pw), so it has no access to the full scenario or to NNN. Its intermediate strings are repetition-free, exclude both ppp and qqq, and have length at most mmm. The set SpqS_{pq}Spq​ contains values in VVV, not NIL; an empty set and a set with multiple values both cause a NIL record. The formal theorem retains the printed n≥mn\ge mn≥m condition, although it is not needed in the proof of the stated set relationships. It also covers p=qp=qp=q, m=0m=0m=0, and empty or singleton processor sets when their quantified conditions apply. These conventions rule out an always-NIL decision rule and the trivial rule that reads σ(q)\sigma(q)σ(q) from outside the receiver's view.

The cryptographic maps ApA_pAp​, their message encodings, and the paper's assertion that practical authenticators can meet the assumption with arbitrarily high probability are outside scope. The formal result assumes the two exact authenticated-scenario conditions. A complete development needs finite-set cardinality and list facts, especially about distinct relay strings and bounded concatenation; these facts can be reused for other authenticated relay models.

Selected references

  • M. Pease, R. Shostak, and L. Lamport, Reaching Agreement in the Presence of Faults, Journal of the ACM 27(2), 1980, 228–234. DOI: 10.1145/322186.322188.
5 thms2 active usersReviewed
🏆Completed
Formal Verification·Captain: mikedeng1

Reaching Agreement in the Presence of Faults 2: If |V| ≥ 2 and 3 ≤ n ≤ 3m, No Family {F_p} Assures Interactive Consistency for m Faults, However Many Rounds Are UsedResearch Paper

Motivation

A fault-tolerant system built from several processors must let its working processors act on the same data, even though some processors may have failed in ways nobody can predict: a failed processor may stop relaying information, relay something it invented, or tell different processors different things. Pease, Shostak and Lamport (J. ACM 27 (1980) 228–234) isolated the core question in the setting of the SIFT aircraft-control computer: each of nnn processors holds a private value, at most mmm processors are faulty, and processors communicate only by two-party messages. Can the nonfaulty processors each compute a vector of values, one entry per processor, such that all nonfaulty processors compute the same vector and the entry of each nonfaulty processor is its true private value? This requirement is called interactive consistency.

The paper answers with a sharp threshold. Interactive consistency can be achieved when n≥3m+1n\ge 3m+1n≥3m+1 (Section 3), and it cannot be achieved when n≤3mn\le 3mn≤3m, however many rounds of message exchange are allowed (Section 4). With unforgeable signatures it can be achieved for every n≥mn\ge mn≥m (Section 5). The impossibility half is the origin of the "3m+13m+13m+1" bound that appears throughout Byzantine fault tolerance, popularised two years later as the Byzantine Generals Problem (Lamport, Shostak, Pease, ACM TOPLAS 4 (1982)). This mission is the impossibility theorem.

Timeline:

  • 1980: Pease, Shostak and Lamport prove the threshold n≥3m+1n\ge 3m+1n≥3m+1 for interactive consistency with oral messages, including the impossibility for n≤3mn\le 3mn≤3m stated in terms of scenarios.
  • 1982: Lamport, Shostak and Pease restate the problem as the Byzantine Generals Problem, with the same bound.
  • 1985–1986: Fischer, Lynch and Merritt give a short "hexagon" proof of the same bound for several agreement problems (Distributed Computing 1 (1986)).

Setting

Let PPP be a finite set of nnn processors and VVV a set of values. Write P∗P^*P∗ for the set of strings over PPP (the empty string included) and P+P^+P+ for the nonempty strings. A string p1p2⋯prp_1p_2\cdots p_rp1​p2​⋯pr​ is read as a chain of reports: p1p_1p1​ was told by p2p_2p2​ that …\dots… pr−1p_{r-1}pr−1​ was told by prp_rpr​ that prp_rpr​'s private value is the recorded value.

A scenario is a map σ:P+→V\sigma: P^+\to Vσ:P+→V. The value σ(p)\sigma(p)σ(p) is processor ppp's private value, and σ(p1⋯pr)\sigma(p_1\cdots p_r)σ(p1​⋯pr​) is the value p1p_1p1​ received for the chain p2⋯prp_2\cdots p_rp2​⋯pr​. For p∈Pp\in Pp∈P, the ppp-scenario σp\sigma_pσp​ is the restriction of σ\sigmaσ to the strings beginning with ppp: everything ppp ever learns.

For a set N⊆PN\subseteq PN⊆P of nonfaulty processors, σ\sigmaσ is consistent with NNN if

σ(pqw)=σ(qw)for all q∈N, p∈P, w∈P∗,\sigma(pqw)=\sigma(qw)\qquad\text{for all }q\in N,\ p\in P,\ w\in P^*,σ(pqw)=σ(qw)for all q∈N, p∈P, w∈P∗,

that is, every nonfaulty processor reports truthfully what it knows or hears. Faulty processors are unconstrained.

A decision family assigns to each p∈Pp\in Pp∈P a map FpF_pFp​ that takes a ppp-scenario and a processor qqq and returns a value Fp(σp,q)∈VF_p(\sigma_p,q)\in VFp​(σp​,q)∈V: the entry ppp computes for qqq. The family assures interactive consistency for mmm faults if for every N⊆PN\subseteq PN⊆P with ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m and every scenario σ\sigmaσ consistent with NNN,

  1. Fp(σp,q)=σ(q)F_p(\sigma_p,q)=\sigma(q)Fp​(σp​,q)=σ(q) for all p,q∈Np,q\in Np,q∈N;
  2. Fp(σp,r)=Fq(σq,r)F_p(\sigma_p,r)=F_q(\sigma_q,r)Fp​(σp​,r)=Fq​(σq​,r) for all p,q∈Np,q\in Np,q∈N, r∈Pr\in Pr∈P.

In the Lean development these are InteractiveConsistency.Impossibility.ConsistentWith P N σ and AssuresIC P m F, with restrict σ p the ppp-scenario.

Formalization targets

Goal: the THEOREM of Section 4

If ∣V∣≥2|V|\ge 2∣V∣≥2 and

3≤n≤3m,3\le n\le 3m,3≤n≤3m,

then no family {Fp∣p∈P}\{F_p\mid p\in P\}{Fp​∣p∈P} assures interactive consistency for mmm faults. Since scenarios are defined on strings of every length, no bound on the number of rounds is assumed.

Milestones, in the order the proof of the paper uses them

  1. If 3≤n≤3m3\le n\le 3m3≤n≤3m, then PPP is the disjoint union of three nonempty sets AAA, BBB, CCC, each with at most mmm members (p. 232).
  2. For such a partition and values v,v′v,v'v,v′, the scenarios α,β,σ\alpha,\beta,\sigmaα,β,σ that the page defines by recursion on the length of strings are consistent with A∪CA\cup CA∪C, B∪CB\cup CB∪C and A∪BA\cup BA∪B respectively (p. 233).
  3. For the same scenarios, α(aw)=σ(aw)\alpha(aw)=\sigma(aw)α(aw)=σ(aw) and β(bw)=σ(bw)\beta(bw)=\sigma(bw)β(bw)=σ(bw) for all a∈Aa\in Aa∈A, b∈Bb\in Bb∈B, w∈P∗w\in P^*w∈P∗ (p. 233).

Significance

The theorem shows that the algorithm of Section 3 is optimal in its fault tolerance: with oral messages, n≥3m+1n\ge 3m+1n≥3m+1 processors are not only sufficient but necessary. Every later lower bound for Byzantine agreement, Byzantine broadcast and approximate agreement with unauthenticated messages rests on this bound or a variant of its argument, and it is the reason replicated state machines tolerating mmm Byzantine faults use 3m+13m+13m+1 replicas. It also explains why Section 5 needs authentication: the argument depends on faulty processors being able to relay fabricated values.

The result has been proved since 1980; what is open here is its formalization. Nothing on Prove2Me models message-passing agreement, and this mission states the theorem in the paper's own model: scenarios on unbounded strings and decision functions of a single ppp-scenario. The mission produces a reusable vocabulary (scenarios, consistency, interactive consistency) and the explicit three-scenario construction.

Difficulty

The obvious attempt is to argue round by round about what a processor can know after kkk rounds; with unboundedly many rounds this never terminates in a contradiction. The paper's argument instead needs three entire scenarios, each a legitimate behaviour for a different set of faulty processors, that two processors cannot tell apart from their own views. Writing these scenarios down so that consistency holds on every string while the indistinguishability survives on every string is the delicate part: the faulty set of each scenario must relay exactly the values that keep the other scenario's view intact, and one of the defining equations (β(paw)=α(aw)\beta(paw)=\alpha(aw)β(paw)=α(aw)) looks like a misprint but is what the argument requires. The counting step is elementary but carries the hypothesis n≥3n\ge 3n≥3 that the printed theorem leaves implicit.

Formalization scope

Processors are a Finset P in a type with decidable equality; strings are lists read left to right (p1p_1p1​ is the head of the list); a scenario is a total function List α → V whose values on the empty list and on lists with a letter outside PPP carry no meaning: every condition quantifies only over strings whose letters lie in PPP. Decision functions have type α → (List α → V) → α → V and are applied only to the ppp-scenario fun w => σ (p :: w), never to σ\sigmaσ; giving FpF_pFp​ the whole scenario would make the problem trivial (output σ(q)\sigma(q)σ(q)). Consistency with NNN constrains only relays by members of NNN, and includes the empty www. The quorum ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m is written ∣P∣≤∣N∣+m|P|\le |N|+m∣P∣≤∣N∣+m, which avoids truncated subtraction on N\mathbb NN. ∣V∣≥2|V|\ge 2∣V∣≥2 is the existence of two distinct values.

Explicit readings of the page:

  • The printed hypothesis "n≥3mn\ge 3mn≥3m" is a misprint for n≤3mn\le 3mn≤3m (the proof opens "Since n≤3mn\le 3mn≤3m", and the section title is "Proof of Impossibility for n<3m+1n<3m+1n<3m+1"); with n≥3mn\ge 3mn≥3m the statement is false.
  • The hypothesis n≥3n\ge 3n≥3 is implicit in the proof's "three nonempty sets". It is necessary: for n≤2n\le 2n≤2 the family Fp(σp,q)=σ(pq)F_p(\sigma_p,q)=\sigma(pq)Fp​(σp​,q)=σ(pq) assures interactive consistency.
  • In the construction, each letter aaa, bbb, ccc ranges independently over AAA, BBB, CCC (so "α(cc)\alpha(cc)α(cc)" covers α(c′c)\alpha(c'c)α(c′c)); the value σ(c′cw)\sigma(c'cw)σ(c′cw), which the page leaves unspecified, is fixed to σ(cw)\sigma(cw)σ(cw).
  • The construction is stated as a definition, and the two "easy" claims about it (consistency, indistinguishability) are separate milestones.

A complete development needs only finite sets and lists from Mathlib. The vocabulary of p. 232 is shared with the other two missions of this series, Reaching Agreement in the Presence of Faults 1 (the algorithm for n≥3m+1n\ge 3m+1n≥3m+1) and 3 (authenticated messages, n≥mn\ge mn≥m), each of which defines it in its own namespace. Proofs of the milestones and of the goal are welcome, as is a proof of the goal by a different route.

Selected references

  • M. Pease, R. Shostak, L. Lamport, Reaching agreement in the presence of faults, Journal of the ACM 27(2) (1980) 228–234. https://doi.org/10.1145/322186.322188
  • L. Lamport, R. Shostak, M. Pease, The Byzantine Generals Problem, ACM Transactions on Programming Languages and Systems 4(3) (1982) 382–401. https://doi.org/10.1145/357172.357176
  • M. J. Fischer, N. A. Lynch, M. Merritt, Easy impossibility proofs for distributed consensus problems, Distributed Computing 1 (1986) 26–39. https://doi.org/10.1007/BF01843568
6 thms2 active usersReviewed
🏆Completed
Formal Verification·Captain: mikedeng1

Reaching Agreement in the Presence of Faults 1: With n ≥ 3m + 1 Processors, the Recursive Majority Procedure on (m + 1)-Level Scenarios Assures Interactive Consistency for m FaultsResearch Paper

Motivation

A fault-tolerant system often replicates a computation on several processors and needs the nonfaulty ones to act on the same data, even though some processors may fail in arbitrary ways: send wrong values, send different values to different recipients, or lie about what they were told. Pease, Shostak and Lamport posed the question in 1980, motivated by the SIFT fault-tolerant aircraft-control computer under development at SRI (Wensley et al. 1978), where it arises in clock synchronization among other places: nnn processors, at most mmm of them faulty, communicate by two-party messages whose sender is always identifiable, and each holds a private value. Can the nonfaulty processors all compute the same vector of values, one entry per processor, whose entry for every nonfaulty processor is that processor's true value? The paper (J. ACM 27 (1980) 228–234) calls this interactive consistency and settles it: possible if and only if n≥3m+1n \ge 3m+1n≥3m+1 when messages can be forged in relay, and possible for every n≥mn \ge mn≥m when they cannot. The same problem, under the name Byzantine generals, became the standard model of arbitrary ("Byzantine") failures in distributed computing (Lamport, Shostak & Pease 1982); the 3m+13m+13m+1 bound underlies the quorum sizes of later replication protocols.

This mission covers the positive half of the paper's characterization: Section 3's recursive procedure, which achieves interactive consistency with n≥3m+1n\ge 3m+1n≥3m+1 processors in m+1m+1m+1 rounds of message exchange.

Setting

Let PPP be a finite set of n=∣P∣n = |P|n=∣P∣ processors and VVV a set of values. A string over a set SSS is a finite sequence p1p2⋯prp_1p_2\cdots p_rp1​p2​⋯pr​ of elements of SSS, repetitions allowed. For k≥1k\ge 1k≥1 a kkk-level scenario is a map σ\sigmaσ from the nonempty strings over PPP of length at most k+1k+1k+1 to VVV. The value σ(p)\sigma(p)σ(p) is ppp's private value VpV_pVp​; for r≥2r\ge 2r≥2, σ(p1p2⋯pr)\sigma(p_1p_2\cdots p_r)σ(p1​p2​⋯pr​) is the value p2p_2p2​ tells p1p_1p1​ that p3p_3p3​ told p2p_2p2​ … that prp_rpr​ told pr−1p_{r-1}pr−1​ is prp_rpr​'s private value. A kkk-level scenario records the outcome of kkk rounds of message exchange.

Faults are modeled by a set N⊆PN\subseteq PN⊆P of nonfaulty processors, unknown to the processors. Nonfaulty processors relay truthfully, so σ\sigmaσ is consistent with NNN when

σ(pqw)=σ(qw)(q∈N, p∈P, w a string over P, ∣pqw∣≤k+1).\sigma(pqw) = \sigma(qw)\qquad (q\in N,\ p\in P,\ w \text{ a string over } P,\ |pqw|\le k+1).σ(pqw)=σ(qw)(q∈N, p∈P, w a string over P, ∣pqw∣≤k+1).

Faulty processors are otherwise unconstrained. A processor ppp sees only its view σp\sigma_pσp​, the restriction of σ\sigmaσ to strings beginning with ppp.

The procedure (p. 230). Processor ppp computes the entry for processor qqq as follows, with nnn and mmm the current processor count and fault bound:

  1. If some Q⊆PQ\subseteq PQ⊆P with ∣Q∣>(n+m)/2|Q|>(n+m)/2∣Q∣>(n+m)/2 and some vvv satisfy σp(pwq)=v\sigma_p(pwq)=vσp​(pwq)=v for every string www over QQQ of length ≤m\le m≤m, record vvv.
  2. Otherwise apply the procedure for m−1m-1m−1, n−1n-1n−1 to the processor set P−{q}P-\{q\}P−{q} and the view σ^p(pw)=σp(pwq)\hat\sigma_p(pw)=\sigma_p(pwq)σ^p​(pw)=σp​(pwq), obtaining a vector of n−1n-1n−1 entries. If at least ⌊(n+m)/2⌋\lfloor (n+m)/2\rfloor⌊(n+m)/2⌋ of them agree, record the common value; otherwise record NIL.

In Lean this is InteractiveConsistency.OralAlgorithm.record m P τ q with τ = fun w => σ (p :: w), values in Option V with none for NIL.

Formalization targets

Goal: the procedure assures interactive consistency

For n≥3m+1n\ge 3m+1n≥3m+1, for every N⊆PN\subseteq PN⊆P with ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m and every (m+1)(m+1)(m+1)-level scenario σ\sigmaσ consistent with NNN,

record(m,P,σp,q)=σ(q)(p,q∈N),record(m,P,σp,r)=record(m,P,σp′,r)(p,p′∈N, r∈P).\mathrm{record}(m,P,\sigma_p,q)=\sigma(q)\quad(p,q\in N),\qquad \mathrm{record}(m,P,\sigma_p,r)=\mathrm{record}(m,P,\sigma_{p'},r)\quad(p,p'\in N,\ r\in P).record(m,P,σp​,q)=σ(q)(p,q∈N),record(m,P,σp​,r)=record(m,P,σp′​,r)(p,p′∈N, r∈P).

This is procedure_assures_ic. It is the paper's claim about this procedure, not an existence statement.

Milestones, in the order the paper's proof uses them

  1. Nonfaulty qqq (p. 231): for p,q∈Np,q\in Np,q∈N, step (1) succeeds and ppp records VqV_qVq​.
  2. Two step-(1) quorums agree (p. 231): if p,p′∈Np,p'\in Np,p′∈N find quorums Q1,Q2Q_1,Q_2Q1​,Q2​ with values v,v′v,v'v,v′, then v=v′v=v'v=v′.
  3. The subscenario (p. 230): for faulty qqq, σ^(w)=σ(wq)\hat\sigma(w)=\sigma(wq)σ^(w)=σ(wq) is an mmm-level scenario on P−{q}P-\{q\}P−{q} consistent with NNN, and ∣N∣≥(n−1)−(m−1)|N|\ge (n-1)-(m-1)∣N∣≥(n−1)−(m−1).
  4. The Q^\hat QQ^​ claim (p. 231): if Q,vQ,vQ,v satisfy step (1) for p′p'p′ and qqq, then Q^=Q−{q}\hat Q=Q-\{q\}Q^​=Q−{q} has at least ⌊(n+m)/2⌋\lfloor(n+m)/2\rfloor⌊(n+m)/2⌋ members and Q^,v\hat Q, vQ^​,v satisfy step (1) of the recursive call for every q′∈Q^q'\in\hat Qq′∈Q^​.

Significance

The theorem is the upper bound in the tight characterization n≥3m+1n\ge 3m+1n≥3m+1 of when interactive consistency is achievable with unauthenticated messages; the matching impossibility (the paper's Section 4 THEOREM) shows that no procedure, with any number of rounds, does better. The procedure is the ancestor of the "oral messages" algorithm OM(m)\mathrm{OM}(m)OM(m) of the Byzantine generals paper, and its quorum arithmetic (∣Q∣>(n+m)/2|Q|>(n+m)/2∣Q∣>(n+m)/2, intersections of two quorums containing a nonfaulty member) recurs throughout Byzantine fault-tolerant replication.

The result is proved in the paper, in a half-page induction. What this mission adds is a machine-checked proof against an explicit model of scenarios, views and consistency with a bounded number of rounds. Machine-checked proofs exist for the related OM(m)\mathrm{OM}(m)OM(m) algorithm of the later Byzantine generals paper in other proof systems; this procedure, with its quorum-based step (1), has to our knowledge not been formalized in Lean, and nothing on message-passing agreement exists on this platform.

Difficulty

Each step of the paper's proof is short, but the bookkeeping is where an argument breaks. The recursion changes three things at once: the processor set loses qqq, the fault bound drops by one, and the scenario becomes σ^(w)=σ(wq)\hat\sigma(w)=\sigma(wq)σ^(w)=σ(wq) of one level less. The induction hypothesis must therefore be stated for every finite processor set and every scenario, and applied to a subscenario whose consistency is inherited only for strings of the right length. The mixed case, where one nonfaulty processor exits at step (1) and another recurses, is the delicate one: the two processors' computations take different branches, and since qqq is faulty nothing forces either value to be qqq's private value. The thresholds are exact: ∣Q∣>(n+m)/2|Q|>(n+m)/2∣Q∣>(n+m)/2 in step (1) and ⌊(n+m)/2⌋\lfloor(n+m)/2\rfloor⌊(n+m)/2⌋ agreeing entries in step (2), both in the current nnn and mmm; off-by-one changes in either break the case analysis. Finally, step (2)'s majority value must be shown unique, so that two processors with the same vector record the same value.

Formalization scope

Processors form a Finset α with decidable equality; strings are List α, read left to right (the receiver first, the originator last), so σp(pwq)\sigma_p(pwq)σp​(pwq) is σ (p :: (w ++ [q])). A scenario is a total function List α → V; consistency with NNN (ConsistentUpTo P N (m + 1) σ) constrains it only on strings over PPP of length at most m+2m+2m+2, the domain of an (m+1)(m+1)(m+1)-level scenario and all the procedure reads. The procedure receives only the view fun w => σ (p :: w), never σ\sigmaσ or NNN. The fault hypothesis ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m is P.card ≤ N.card + m; m=0m=0m=0 is included.

Explicit readings of the paper's prose: "size >(n+m)/2>(n+m)/2>(n+m)/2" is P.card + m < 2 * Q.card; ⌊(n+m)/2⌋\lfloor(n+m)/2\rfloor⌊(n+m)/2⌋ is natural-number division; "strings over QQQ of length ≤m\le m≤m" includes the empty string and allows repetitions; the step-(2) vector is indexed by P.erase q and includes ppp's own entry; the recorded value in step (1) is σp(pq)\sigma_p(pq)σp​(pq) (the empty string forces it); when several values reach the step-(2) threshold one is chosen deterministically from the vector (under the goal's hypotheses at most one does); for m=0m=0m=0 a failing step (1) records NIL (never reached under the hypotheses). Two printed slips are corrected in the Lean: "records VqV_qVq​ and qqq" (for "for qqq") and "σp′(p′wq′)\sigma_{p'}(p'wq')σp′​(p′wq′)" (for σ^p′\hat\sigma_{p'}σ^p′​).

Trivializing formalizations are ruled out: the procedure never sees σ\sigmaσ itself (with it, recording σ(q)\sigma(q)σ(q) would be trivial), consistency constrains only relays by nonfaulty processors, and NNN ranges over every subset of size at least n−mn-mn−m.

The development needs only finite sets and lists; no library beyond Mathlib is required. The quorum-intersection lemmas and the subscenario construction are reusable for other oral-message protocols. Contributions welcome: proofs of the four milestones, the goal by induction on mmm, and a computable version of the procedure for concrete instances. This is mission 1 of a series of three on this paper; mission 2 formalizes the impossibility THEOREM for n≤3mn\le 3mn≤3m (Section 4), and mission 3 the authenticated-message procedure for every n≥mn\ge mn≥m (Section 5).

Selected references

  • M. Pease, R. Shostak, L. Lamport, Reaching agreement in the presence of faults, Journal of the ACM 27(2), 1980, 228–234. https://doi.org/10.1145/322186.322188
  • L. Lamport, R. Shostak, M. Pease, The Byzantine generals problem, ACM Transactions on Programming Languages and Systems 4(3), 1982, 382–401. https://doi.org/10.1145/357172.357176
  • J. H. Wensley et al., SIFT: Design and analysis of a fault-tolerant computer for aircraft control, Proceedings of the IEEE 66(10), 1978, 1240–1255. https://doi.org/10.1109/PROC.1978.11114
7 thms2 active usersReviewed
🏆Completed
CombinatoricsNumber TheoryProbability·Captain: mikedeng1

A New Class of Random Number Generators 1: For Prime m = bʳ + bˢ − 1, Every Nontrivial Add-with-Carry Sequence Is Periodic After r Steps, with Period the Order of b mod mResearch Paper

Why add-with-carry generators

Simulation, Monte Carlo integration and randomized algorithms consume long streams of numbers that should behave like independent uniform draws. A deterministic generator with finite state is eventually periodic, so its period is the first figure of merit: a stream cannot be longer than its cycle. G. Marsaglia and A. Zaman, A new class of random number generators (Ann. Appl. Probab. 1 (1991)), introduced the add-with-carry and subtract-with-borrow generators. They keep rrr machine words plus one carry bit, use only additions or subtractions of words, and still reach periods such as 26402^{640}2640 when the base bbb is near 2322^{32}232 (p. 465). The paper's mechanism for this is number-theoretic: the generated digits are the base-bbb digits of a fraction k/mk/mk/m written backwards, so the period of the generator is the period of a repeating base-bbb expansion, i.e. the multiplicative order of bbb modulo mmm.

Generators of this family were used widely in the following decades (Lüscher's RANLUX generator in lattice field theory is built on subtract-with-borrow), and later work showed that they are equivalent to linear congruential generators with modulus mmm (Tezuka, L'Ecuyer and Couture 1993). This mission treats the add-with-carry generator. A companion mission treats subtract-with-borrow.

Setting

Fix a base b≥2b \ge 2b≥2 and two lags rrr and sss with 0<s<r0 < s < r0<s<r. A state (or seed vector) is

x=(x1,x2,…,xr,c),x = (x_1, x_2, \dots, x_r, c),x=(x1​,x2​,…,xr​,c),

where each xi∈{0,1,…,b−1}x_i \in \{0, 1, \dots, b-1\}xi​∈{0,1,…,b−1} is a base-bbb digit and c∈{0,1}c \in \{0, 1\}c∈{0,1} is the carry bit. The digit x1x_1x1​ is the oldest one. The add-with-carry map fff (p. 465) is

f(x1,…,xr,c)={(x2,…,xr, xr+1−s+x1+c, 0)if xr+1−s+x1+c<b,(x2,…,xr, xr+1−s+x1+c−b, 1)if xr+1−s+x1+c≥b,f(x_1, \dots, x_r, c) = \begin{cases} (x_2, \dots, x_r,\ x_{r+1-s} + x_1 + c,\ 0) & \text{if } x_{r+1-s} + x_1 + c < b,\\ (x_2, \dots, x_r,\ x_{r+1-s} + x_1 + c - b,\ 1) & \text{if } x_{r+1-s} + x_1 + c \ge b, \end{cases}f(x1​,…,xr​,c)={(x2​,…,xr​, xr+1−s​+x1​+c, 0)(x2​,…,xr​, xr+1−s​+x1​+c−b, 1)​if xr+1−s​+x1​+c<b,if xr+1−s​+x1​+c≥b,​

and the generated sequence of a seed xxx is x,f(x),f2(x),…x, f(x), f^2(x), \dotsx,f(x),f2(x),…. Reading off the last digit of each state gives a digit stream x1,…,xr,xr+1,xr+2,…x_1, \dots, x_r, x_{r+1}, x_{r+2}, \dotsx1​,…,xr​,xr+1​,xr+2​,… obeying xn=xn−r+xn−s+c mod bx_n = x_{n-r} + x_{n-s} + c \bmod bxn​=xn−r​+xn−s​+cmodb, with the carry updated at each step. The two trivial seeds are (0,…,0,0)(0, \dots, 0, 0)(0,…,0,0) and (b−1,…,b−1,1)(b-1, \dots, b-1, 1)(b−1,…,b−1,1). The modulus of the generator is

m=br+bs−1.m = b^r + b^s - 1 .m=br+bs−1.

For 0≤k<m0 \le k < m0≤k<m and j≥1j \ge 1j≥1, the jjj-th base-bbb digit of k/mk/mk/m after the point is dj(k/m)=⌊b⋅(bj−1k mod m)/m⌋d_j(k/m) = \lfloor b \cdot (b^{j-1} k \bmod m) / m \rfloordj​(k/m)=⌊b⋅(bj−1kmodm)/m⌋. The order ord⁡m(b)\operatorname{ord}_m(b)ordm​(b) is the least p≥1p \ge 1p≥1 with bp≡1(modm)b^p \equiv 1 \pmod mbp≡1(modm), and bbb is a primitive root of a prime mmm when ord⁡m(b)=m−1\operatorname{ord}_m(b) = m - 1ordm​(b)=m−1.

Formalization targets

Goal: the period is the order of bbb

Let m=br+bs−1m = b^r + b^s - 1m=br+bs−1 be prime, and let xxx be any seed other than the two trivial seeds. Then fr(x)f^r(x)fr(x) is a periodic point of fff and

min⁡{p≥1:fp(fr(x))=fr(x)}=ord⁡m(b).\min\{p \ge 1 : f^{p}(f^{r}(x)) = f^{r}(x)\} = \operatorname{ord}_m(b).min{p≥1:fp(fr(x))=fr(x)}=ordm​(b).

This is the italic summary of p. 472 ("whatever the seed vector, except for the two trivial seeds, the add-with-carry and subtract-with-borrow sequences become periodic after a few iterations of the generating function, and the periods are the order of the base bbb for the appropriate modulus"), with the claim of §4.2 (p. 467) and its proof (p. 468). The goal fixes no particular bbb, rrr, sss and does not assume that bbb is a primitive root. When it is, the period is br+bs−2b^r + b^s - 2br+bs−2, the value announced in §2.

Milestones

  1. §4.1 (p. 467): for gcd⁡(k,m)=gcd⁡(b,m)=1\gcd(k, m) = \gcd(b, m) = 1gcd(k,m)=gcd(b,m)=1, p>0p > 0p>0 is a period of the base-bbb expansion of k/mk/mk/m iff ord⁡m(b)∣p\operatorname{ord}_m(b) \mid pordm​(b)∣p.
  2. §4.1 (p. 467): if bbb is a primitive root of the prime mmm, every proper fraction k/mk/mk/m has least period m−1m - 1m−1.
  3. p. 472: f(x)=xf(x) = xf(x)=x iff xxx is a trivial seed.
  4. p. 472: fr(x)f^r(x)fr(x) is periodic for every seed.
  5. §4.2 (p. 468): for every seed other than (b−1,…,b−1,1)(b-1, \dots, b-1, 1)(b−1,…,b−1,1) and every CCC, there is 0≤k<m0 \le k < m0≤k<m, positive iff the seed is nonzero, with
xn=dC+1−n(k/m)(r+1≤n≤C).x_n = d_{C+1-n}(k/m) \qquad (r + 1 \le n \le C).xn​=dC+1−n​(k/m)(r+1≤n≤C).
  1. p. 472, Method 3: xxx is periodic iff c=0c = 0c=0 and xr⋯xs+1≥xr−s⋯x1x_r \cdots x_{s+1} \ge x_{r-s} \cdots x_1xr​⋯xs+1​≥xr−s​⋯x1​, or c=1c = 1c=1 and xr⋯xs+1≤xr−s⋯x1x_r \cdots x_{s+1} \le x_{r-s} \cdots x_1xr​⋯xs+1​≤xr−s​⋯x1​ (digit strings read as base-bbb integers).
  2. §2 (p. 465): the instance b=10b = 10b=10, r=2r = 2r=2, s=1s = 1s=1, period 108108108.
  3. §7 (p. 477): the instance b=6b = 6b=6, r=21r = 21r=21, s=2s = 2s=2, period 621+62−26^{21} + 6^2 - 2621+62−2.

Significance

The result. The goal reduces the period of the generator, a property of a dynamical system on 2br2b^r2br states, to the multiplicative order of one residue. That is the computation the paper performs in §6 to certify its recommended generators, and it is how one chooses b,r,sb, r, sb,r,s: search for primes m=br+bs−1m = b^r + b^s - 1m=br+bs−1 and check the order of bbb. Milestone 5 is stronger than the goal. It needs no primality and identifies the whole output stream, not only its period, with the expansion of a fraction. That identification is what later work used to relate carry generators to linear congruential generators with modulus mmm. Milestone 6 answers the paper's "periodic seed" puzzle: it says exactly which seeds lie on their own cycle.

Formalizing it. The results are proved in the paper, the general §4.1 facts are classical, and the method-specific rules of §4.5 (milestone 6) are stated there without proof. None of it is machine-checked on Prove2Me or, to our knowledge, in Mathlib, which has orderOf and ZMod but no theory of base-bbb expansions of rationals. The mission produces a checked link from a concrete integer recurrence to modular arithmetic. That link can serve as a template for other carry-based and lagged generators.

Difficulty

The obvious argument says the digit recurrence is linear, so the period divides something like the order of a companion matrix. This fails because of the carry: fff is not linear over Z/b\mathbb{Z}/bZ/b, and the state (x1,…,xr,c)(x_1, \dots, x_r, c)(x1​,…,xr​,c) does not live in a group in any evident way. The link to the order of bbb modulo mmm goes through an identity between a finite digit string and a fraction (milestone 5). Stating it with exact indices is itself delicate: the digits run in reverse order, the fraction depends on the string's length, and the trivial seed (b−1,…,b−1,1)(b-1, \dots, b-1, 1)(b−1,…,b−1,1), whose digits are those of m/m=1m/m = 1m/m=1, has to be excluded.

A second difficulty is the preperiod. A seed need not lie on its own cycle (p. 472), so the period must be measured after the transient. Bounding that transient by rrr (milestone 4) and characterising the periodic seeds (milestone 6) are separate combinatorial facts about the carry. The paper states the second without proof.

Formalization scope

  • Representation. All declarations are in namespace CarryRNG.AWC. Lags are a structure Lags with fields r, s and proofs of 0<s0 < s0<s and s<rs < rs<r. A state is a structure with digits x : Fin r → Fin b and carry c : Fin 2, so c≤1c \le 1c≤1 holds by typing. Lean index iii is the paper's xi+1x_{i+1}xi+1​: x 0 is x1x_1x1​ (the digit the step drops), and the partner digit xr+1−sx_{r+1-s}xr+1−s​ is index r−sr - sr−s. step is defined directly from the two-case formula of p. 465, not through k/mk/mk/m. The digit stream out is one-based: the seed digits for n≤rn \le rn≤r, then the last digit of f n−r(x)f^{\,n-r}(x)fn−r(x). digit b m k j is the exact integer formula above, used for j≥1j \ge 1j≥1 only.
  • Period. "The period" is Mathlib's Function.minimalPeriod. It is 000 at non-periodic points, so the goal's equation with the positive ord⁡m(b)\operatorname{ord}_m(b)ordm​(b) also asserts periodicity. A divisibility or inequality form would be vacuous and is not used. For digit sequences, "period LLL" is stated as "p>0p > 0p>0 is a period iff L∣pL \mid pL∣p".
  • Quantifier readings. "With appropriately chosen base bbb, lags rrr and sss and seed vector xxx" (p. 465) is read as: mmm prime and xxx not a trivial seed, following p. 468 ("Making mmm a prime ensures this") and p. 472. "After a few iterations" is "after at most rrr", the paper's own bound (p. 472), so the goal is stated at fr(x)f^r(x)fr(x). In milestone 5 the fraction kkk depends on the length CCC of the finite string, as in the paper's "arbitrarily long finite string". In milestone 8, "for any set of 21 seed digits" is stated at f21(x)f^{21}(x)f21(x) for the same reason.
  • Corrected misprints. p. 465 prints the second trivial seed as "(9, 9, 9)"; the last entry is the carry, so milestone 7 excludes (9,9,1)(9, 9, 1)(9,9,1). p. 473, example (a), prints the Method 3 inequalities reversed; milestone 6 follows p. 472, which exhaustive checks on small parameters confirm. p. 478 repeats the die period with "− 1" for "− 2"; milestone 8 quotes p. 477.
  • Ruled-out trivializations. The goal is not "some period divides m−1m - 1m−1" and not "every orbit is eventually periodic". Both hold for any self-map of a finite set or are vacuous. The trivial seeds are named states, not excluded by an assumption such as f(x)≠xf(x) \neq xf(x)=x.
  • Infrastructure and contributions. Needed: periods of base-bbb expansions of rationals (milestones 1–2, reusable beyond this mission) and finite-dynamics facts about minimalPeriod along an orbit. Proofs of any milestone are welcome, as are primality and order certificates for milestone 8 as separate lemmas.

Selected references

  • G. Marsaglia and A. Zaman, A new class of random number generators, Ann. Appl. Probab. 1(3) (1991), 462–480. https://doi.org/10.1214/aoap/1177005878
  • S. Tezuka, P. L'Ecuyer and R. Couture, On the lattice structure of the add-with-carry and subtract-with-borrow random number generators, ACM Trans. Model. Comput. Simul. 3(4) (1993), 315–331. https://doi.org/10.1145/159737.159749
  • R. Couture and P. L'Ecuyer, Distribution properties of multiply-with-carry random number generators, Math. Comp. 66 (1997), 591–607. https://doi.org/10.1090/S0025-5718-97-00827-2
  • M. Lüscher, A portable high-quality random number generator for lattice field theory simulations, Comput. Phys. Commun. 79 (1994), 100–110. https://doi.org/10.1016/0010-4655(94)90232-1
17 thms2 active usersReviewed
🏆Completed
Machine LearningOperations ResearchProbability·Captain: mikedeng1

The Weighted Majority Algorithm 6: Under the Weak Independence Condition, the Randomized Master WMR Has E(m) ≤ E(ln(w_init/w_fin))/(1−β)Research Paper

Motivation

Prediction with expert advice asks a learner to predict a binary label in each of a sequence of trials, having seen the predictions of a pool of nnn prediction algorithms (the experts), and to make not many more mistakes than the best of them, with no probabilistic assumption on how the instances and labels are generated. Littlestone and Warmuth's Weighted Majority Algorithm (Littlestone, Warmuth 1994) maintains a weight for each pool member, predicts by a weighted vote, and shrinks the weights of members that err. Its mistake bounds are the origin of the multiplicative-weights method used throughout online learning, game theory and optimization (Arora, Hazan, Kale 2012).

A deterministic master with binary predictions can be forced to err in every trial in which the weight is split evenly, which costs it a factor of about two against the best expert. Section 6 of the paper introduces a randomized master, WMR, which predicts 111 with probability equal to the weighted average prediction of the pool. Theorem 6.1 bounds its expected number of mistakes under a precisely stated condition on how its randomization interacts with the choice of instances and labels.

Timeline:

  • 1989: Littlestone and Warmuth's technical report and FOCS paper introduce the Weighted Majority Algorithm and its randomized variant.
  • 1991: Maass independently analyses the case β=0\beta = 0β=0 with binary pool predictions and a lazy update ([Maa91], cited in the paper).
  • 1994: the journal version states the weak independence condition and proves Theorem 6.1 (p. 240).
  • 1997: Freund and Schapire's Hedge algorithm recasts the randomized master as a distribution over experts in a decision-theoretic setting (Freund, Schapire 1997).

Setting

A pool of nnn algorithms is run for ttt trials on a probability space (Ω,F,P)(\Omega, \mathcal F, P)(Ω,F,P). In trial jjj the pool member iii predicts xi(j)∈[0,1]x_i^{(j)} \in [0,1]xi(j)​∈[0,1], the label is ρ(j)∈{0,1}\rho^{(j)} \in \{0,1\}ρ(j)∈{0,1}, and the master predicts λ(j)∈{0,1}\lambda^{(j)} \in \{0,1\}λ(j)∈{0,1}. All of these are random variables; deterministic sequences are a special case. Write x(j)=(x1(j),…,xn(j))x^{(j)} = (x_1^{(j)}, \dots, x_n^{(j)})x(j)=(x1(j)​,…,xn(j)​).

Each member carries a weight. The initial weights wi(1)w_i^{(1)}wi(1)​ are positive, and the update step (5.1) multiplies the weight of member iii in trial jjj by a factor FFF that depends on β\betaβ, xi(j)x_i^{(j)}xi(j)​ and ρ(j)\rho^{(j)}ρ(j):

wi(j+1)=F wi(j),β∣xi(j)−ρ(j)∣≤F≤1−(1−β) ∣xi(j)−ρ(j)∣,w_i^{(j+1)} = F\,w_i^{(j)}, \qquad \beta^{|x_i^{(j)}-\rho^{(j)}|} \le F \le 1-(1-\beta)\,|x_i^{(j)}-\rho^{(j)}|,wi(j+1)​=Fwi(j)​,β∣xi(j)​−ρ(j)∣≤F≤1−(1−β)∣xi(j)​−ρ(j)∣,

where 0≤β<10 \le \beta < 10≤β<1 and 00=10^0 = 100=1. WMR updates in every trial. Let s(j)=∑iwi(j)s^{(j)} = \sum_i w_i^{(j)}s(j)=∑i​wi(j)​, so s(1)=winits^{(1)} = w_{\mathrm{init}}s(1)=winit​ and s(t+1)=wfins^{(t+1)} = w_{\mathrm{fin}}s(t+1)=wfin​, and let

γ(j)=∑i=1nwi(j)xi(j)s(j)\gamma^{(j)} = \frac{\sum_{i=1}^n w_i^{(j)} x_i^{(j)}}{s^{(j)}}γ(j)=s(j)∑i=1n​wi(j)​xi(j)​​

be the weighted average prediction. WMR predicts 111 with probability γ(j)\gamma^{(j)}γ(j). Its number of mistakes is m=∑j=1t∣λ(j)−ρ(j)∣m = \sum_{j=1}^t |\lambda^{(j)} - \rho^{(j)}|m=∑j=1t​∣λ(j)−ρ(j)∣.

The weak independence condition (p. 238) requires, for j=1,…,tj = 1, \dots, tj=1,…,t,

E(λ(j) ∣ (x(1),ρ(1)),…,(x(j),ρ(j)))=γ(j)almost surely.\mathbf E\big(\lambda^{(j)} \,\big|\, (x^{(1)},\rho^{(1)}), \dots, (x^{(j)},\rho^{(j)})\big) = \gamma^{(j)} \quad \text{almost surely}.E(λ(j)​(x(1),ρ(1)),…,(x(j),ρ(j)))=γ(j)almost surely.

The conditioning includes the current predictions of the pool and the current label. It allows instances and labels to depend on the master's past predictions, and it holds, for instance, when WMR draws one uniform number r∈[0,1]r \in [0,1]r∈[0,1] and predicts 111 whenever γ(j)≥r\gamma^{(j)} \ge rγ(j)≥r, provided the instances and labels are generated independently of rrr.

Formalization targets

Goal: Theorem 6.1

Under the weak independence condition, and with wfin>0w_{\mathrm{fin}} > 0wfin​>0 almost surely,

E(m)≤E(ln⁡(winit/wfin))1−β.\mathbf E(m) \le \frac{\mathbf E\big(\ln(w_{\mathrm{init}}/w_{\mathrm{fin}})\big)}{1-\beta}.E(m)≤1−βE(ln(winit​/wfin​))​.

The statement fixes neither the pool, nor the update factors within (5.1), nor the distribution of instances and labels.

Milestone: expected mistakes equal expected loss of the weighted average

The step of the proof on p. 240: under the weak independence condition, E(∣λ(j)−ρ(j)∣∣Fj)=∣γ(j)−ρ(j)∣\mathbf E(|\lambda^{(j)}-\rho^{(j)}| \mid \mathcal F_j) = |\gamma^{(j)}-\rho^{(j)}|E(∣λ(j)−ρ(j)∣∣Fj​)=∣γ(j)−ρ(j)∣ almost surely, and hence

E(m)=E(∑j=1t∣γ(j)−ρ(j)∣).\mathbf E(m) = \mathbf E\Big(\sum_{j=1}^t |\gamma^{(j)}-\rho^{(j)}|\Big).E(m)=E(j=1∑t​∣γ(j)−ρ(j)∣).

Significance

Theorem 6.1 gives the randomized master the same bound that Theorem 5.2 gives the deterministic master WMC, whose predictions are allowed to lie in [0,1][0,1][0,1]. With equal initial weights, ln⁡(winit/wfin)≤ln⁡n+miln⁡(1/β)\ln(w_{\mathrm{init}}/w_{\mathrm{fin}}) \le \ln n + m_i \ln(1/\beta)ln(winit​/wfin​)≤lnn+mi​ln(1/β) for every pool member iii with total loss mim_imi​, and the bound yields Corollary 6.1 (p. 241): E(m)≤(ln⁡n+E(mi)ln⁡(1/β))/(1−β)\mathbf E(m) \le (\ln n + \mathbf E(m_i)\ln(1/\beta))/(1-\beta)E(m)≤(lnn+E(mi​)ln(1/β))/(1−β). For β\betaβ close to 111 this is better by nearly a factor of two than the bound for the deterministic binary master WMG. The weak independence condition is also what makes the bound valid against labels that adapt to the master's past predictions, which is the setting of later regret analyses.

The result is proved in the paper; this mission produces a machine-checked version. The platform has proofs of the randomized weighted majority bound in the form of Hazan's Lemma 1.4 and of Mohri et al.'s Theorem 8.4, but both state an expectation over the algorithm's internal distribution with deterministic data, unit weights and one fixed update rule. Neither covers random instances and labels, the conditional-expectation condition, or the whole class of updates (5.1).

Difficulty

The pathwise part of the argument is the loss bound for the weighted average (Lemma 5.3, posed in the companion mission on WMC). The new difficulty is probabilistic. The predictions, labels and weights are random and may depend on each other across trials, so the mistake indicator ∣λ(j)−ρ(j)∣|\lambda^{(j)}-\rho^{(j)}|∣λ(j)−ρ(j)∣ cannot be replaced by ∣γ(j)−ρ(j)∣|\gamma^{(j)}-\rho^{(j)}|∣γ(j)−ρ(j)∣ pointwise. The replacement holds only after conditioning on the σ\sigmaσ-algebra Fj\mathcal F_jFj​, and requires that ρ(j)\rho^{(j)}ρ(j) is Fj\mathcal F_jFj​-measurable and binary, so that the indicator is affine in λ(j)\lambda^{(j)}λ(j). A reading that conditions on less (dropping the current label) or uses unconditional expectations does not support this step when the label depends on earlier randomness.

A second difficulty is that E(ln⁡(winit/wfin))\mathbf E(\ln(w_{\mathrm{init}}/w_{\mathrm{fin}}))E(ln(winit​/wfin​)) may be infinite: the weights can become arbitrarily small with positive probability.

Formalization scope

The pool is Fin n; trials are indexed from 000 to t−1t-1t−1, so totalWeight … 0 is winitw_{\mathrm{init}}winit​ and totalWeight … t is wfinw_{\mathrm{fin}}wfin​. The probability space is a measure P with IsProbabilityMeasure P. Predictions, labels and master predictions are real-valued measurable random variables; pool predictions lie in [0,1][0,1][0,1] and labels and master predictions in {0,1}\{0,1\}{0,1} on every sample path. Initial weights are deterministic and positive. The update factor of member iii in trial jjj is a measurable function Fj,i(x,r)F_{j,i}(x, r)Fj,i​(x,r) of the member's prediction and the label, satisfying (5.1) on every sample path; the weights are computed from it, so they are random variables determined by the predictions and labels. Fj\mathcal F_jFj​ is the supremum of the σ\sigmaσ-algebras generated by the pairs (x(k),ρ(k))(x^{(k)}, \rho^{(k)})(x(k),ρ(k)), k≤jk \le jk≤j, and the weak independence condition is stated with Mathlib's conditional expectation P[λ j | 𝓕 j].

Expectations in the goal are lower Lebesgue integrals in [0,∞][0,\infty][0,∞], so the right-hand side may be +∞+\infty+∞ and no integrability of the logarithm is assumed. The hypothesis wfin>0w_{\mathrm{fin}} > 0wfin​>0 almost surely excludes the case where the paper's bound is infinite and Lean's ln⁡0=0\ln 0 = 0ln0=0 would make the literal statement false. A formalization that replaces the conditional expectation by the unconditional one, takes the logarithm's Bochner integral (which is 000 when the logarithm is not integrable), or restricts to deterministic instances and labels does not state Theorem 6.1.

A complete development needs the pathwise loss bound of Lemma 5.3 for this weight model, the pull-out property of conditional expectations for bounded measurable factors, and the exchange of expectation and finite sums. The weight model and the filtration are reusable for Theorem 6.3 and for the lazy variant of the Appendix. Proofs of the milestone and of the goal are welcome, as are formalizations of Corollary 6.1.

Selected references

  • N. Littlestone, M. K. Warmuth, The Weighted Majority Algorithm, Information and Computation 108(2), 212–261, 1994. https://doi.org/10.1006/inco.1994.1009
  • Y. Freund, R. E. Schapire, A Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting, Journal of Computer and System Sciences 55(1), 119–139, 1997. https://doi.org/10.1006/jcss.1997.1504
  • S. Arora, E. Hazan, S. Kale, The Multiplicative Weights Update Method: a Meta-Algorithm and Applications, Theory of Computing 8, 121–164, 2012. https://doi.org/10.4086/toc.2012.v008a006
  • N. Cesa-Bianchi, G. Lugosi, Prediction, Learning, and Games, Cambridge University Press, 2006. https://doi.org/10.1017/CBO9780511546921
3 thms2 active usersReviewed
🏆Completed
Machine LearningOperations Research·Captain: mikedeng1

The Weighted Majority Algorithm 3: On a Countably Infinite Pool, WMI2 Makes at Most inf_i (log(Ŵ(1)/W(i)) + m_i log(1/β) + log 2)/log(1/u) MistakesResearch Paper

Motivation

In prediction with expert advice, a master algorithm predicts a binary label in each of a sequence of trials, after seeing the predictions of a pool of other algorithms (the "experts"), and is charged one mistake whenever its prediction differs from the label. No probabilistic assumption is made on the sequence: the goal is a bound on the master's mistakes, valid for every sequence, in terms of the mistakes of the best pool member. The Weighted Majority Algorithm of Littlestone and Warmuth (Inform. and Comput. 108, 1994) achieves this for a finite pool of nnn members with O(log⁡n+mi)O(\log n + m_i)O(logn+mi​) mistakes, where mim_imi​ is the number of mistakes of member iii.

Many natural pools are infinite: all programs in an enumeration, all hypotheses of a countable class, all values of a discretised parameter. Section 4 of the paper asks whether a master can compete with every member of a countably infinite pool A1,A2,…A_1, A_2, \dotsA1​,A2​,…, making at most c(log⁡i+mi)c(\log i + m_i)c(logi+mi​) mistakes for every iii, while keeping only finitely many weights at any time. Running the Weighted Majority Algorithm on infinitely many weights would give such a bound, but cannot be implemented.

Timeline. Barzdin and Freivalds (1972, 1974) studied prediction of a sequence by an enumerable family of functions and gave an essentially optimal bound for the case of a pool containing a member consistent with the whole sequence (β=0\beta = 0β=0 below). Littlestone and Warmuth's earlier versions of the paper (1989) introduced an algorithm WMI for infinite pools; the journal version (1994) replaced it by WMI2\mathrm{WMI}_2WMI2​, which matches the Barzdin–Freivalds bound when β=0\beta = 0β=0 and a consistent member exists, and extends it to pools in which every member may err.

Setting

Fix a parameter β\betaβ with 0≤β<10 \le \beta < 10≤β<1 and put u=(1+β)/2u = (1+\beta)/2u=(1+β)/2. Fix two real functions WWW and W^\hat WW^ on the positive integers with

W(i)>0,∑iW(i)<∞,W^(i)≥∑j≥iW(j),lim⁡i→∞W^(i)=0.W(i) > 0, \qquad \sum_{i} W(i) < \infty, \qquad \hat W(i) \ge \sum_{j \ge i} W(j), \qquad \lim_{i \to \infty} \hat W(i) = 0 .W(i)>0,i∑​W(i)<∞,W^(i)≥j≥i∑​W(j),i→∞lim​W^(i)=0.

W(i)W(i)W(i) is the initial weight of the pool member AiA_iAi​, and W^(i)\hat W(i)W^(i) bounds the weight of the tail Ai,Ai+1,…A_i, A_{i+1}, \dotsAi​,Ai+1​,….

A sequence of TTT trials gives, for each trial ttt, the prediction xt(i)∈{0,1}x_t(i) \in \{0,1\}xt​(i)∈{0,1} of every pool member and a label ρt∈{0,1}\rho_t \in \{0,1\}ρt​∈{0,1}. Member AiA_iAi​ makes at most mim_imi​ mistakes: xt(i)≠ρtx_t(i) \ne \rho_txt​(i)=ρt​ for at most mim_imi​ trials ttt.

The master WMI2\mathrm{WMI}_2WMI2​ keeps an active pool A1,…,AlA_1, \dots, A_lA1​,…,Al​ and a weight for each active member. With mmm the number of its own mistakes so far, let

θ(m)=um+1 W^(1)(1−β)(m+1)(m+2).\theta(m) = \frac{u^{m+1}\,\hat W(1)}{(1-\beta)(m+1)(m+2)} .θ(m)=(1−β)(m+1)(m+2)um+1W^(1)​.

Initially, and after each trial in which it errs, WMI2\mathrm{WMI}_2WMI2​ raises lll (starting from l=0l = 0l=0) to the least value with W^(l+1)≤θ(m)\hat W(l+1) \le \theta(m)W^(l+1)≤θ(m); a newly activated AiA_iAi​ gets weight W(i)W(i)W(i). In a trial it computes the active weight q0q_0q0​ predicting 000 and q1q_1q1​ predicting 111; it predicts 000 if q0>q1+θ(m)q_0 > q_1 + \theta(m)q0​>q1​+θ(m), predicts 111 if q1>q0+θ(m)q_1 > q_0 + \theta(m)q1​>q0​+θ(m), and may predict either otherwise. After a mistake, every active member that disagreed with the label has its weight multiplied by β\betaβ. The weights ωi\omega_iωi​ of the analysis are the current weight of an active member and W(i)W(i)W(i) for an inactive one.

Formalization targets

The goal is Theorem 4.1, part 3 (p. 227). Let mmm be the total number of mistakes of WMI2\mathrm{WMI}_2WMI2​ on the sequence.

Goal: the mistake bound of WMI2\mathrm{WMI}_2WMI2​

If 0<β<10 < \beta < 10<β<1, then

m≤inf⁡i≥1log⁡(W^(1)/W(i))+milog⁡(1/β)+log⁡2log⁡(1/u),m \le \inf_{i \ge 1} \frac{\log\bigl(\hat W(1)/W(i)\bigr) + m_i \log(1/\beta) + \log 2}{\log(1/u)} ,m≤i≥1inf​log(1/u)log(W^(1)/W(i))+mi​log(1/β)+log2​,

and if β=0\beta = 0β=0 and mi=0m_i = 0mi​=0 for some iii, then m≤1+log⁡2(W^(1)/W(i))m \le 1 + \log_2\bigl(\hat W(1)/W(i)\bigr)m≤1+log2​(W^(1)/W(i)).

Milestone: the size of the active pool (Theorem 4.1, part 1)

At the beginning of any trial, lll is the minimum lll with W^(l+1)≤θ(m)\hat W(l+1) \le \theta(m)W^(l+1)≤θ(m), where mmm counts the mistakes made in prior trials.

Milestone: the weight invariant (Theorem 4.1, part 2)

After any initial sequence of trials in which mmm mistakes have been made,

∑i=1∞ωi≤(2−1m+1)um W^(1).\sum_{i=1}^{\infty} \omega_i \le \Bigl(2 - \frac{1}{m+1}\Bigr) u^{m}\, \hat W(1) .i=1∑∞​ωi​≤(2−m+11​)umW^(1).

Significance

The result. The bound holds simultaneously for every pool member, so the master competes with the best member of an infinite pool, paying log⁡(W^(1)/W(i))\log(\hat W(1)/W(i))log(W^(1)/W(i)) for the position of that member in the enumeration. With W(i)=1/(i(i+1))W(i) = 1/(i(i+1))W(i)=1/(i(i+1)) and W^(i)=1/i\hat W(i) = 1/iW^(i)=1/i (the paper's Corollary 4.1) this is O(log⁡i+mi)O(\log i + m_i)O(logi+mi​) mistakes, with an active pool that grows exponentially in the number of mistakes but is finite at every time. Different choices of WWW trade the mistake bound against the growth of the active pool. The same analysis shows how the predictions can be computed from finite-precision approximations of the weights, which is the reason for the slack band in the prediction rule. Its β=0\beta = 0β=0 case recovers the Barzdin–Freivalds bound.

Formalizing it. The theorem is proved in the paper; no machine-checked version is known to exist, and there is no formalization of the Weighted Majority Algorithm on infinite pools on Prove2Me. The work is to formalize the paper's proof: the size statement for the active pool, the inductive invariant for the total weight, and the final logarithmic bound. The definition of a run of WMI2\mathrm{WMI}_2WMI2​, with free predictions in the slack band and lazily activated weights, is reusable for other lazy-activation algorithms on countable pools, and the paper's Corollaries 4.1–4.3 are direct instances once the goal is proved.

Difficulty

The ordinary Weighted Majority analysis tracks the total weight of the whole pool, which shrinks by the factor uuu after each mistake. For WMI2\mathrm{WMI}_2WMI2​ that argument does not apply as is: the master only sees the active weights, and the inactive tail, whose weight is unknown to the algorithm and charged at its initial value, may vote with the label. The obvious bound on the tail is too weak if applied with a fixed slack; it must shrink with the number of mistakes at the right rate so that the accumulated overhead stays below a constant factor. The slack band in the prediction rule interacts with this: when the master errs inside the band, the active majority may not have been wrong by much, and the shrinkage factor must be recovered from the band's width. The factor 2−1/(m+1)2 - 1/(m+1)2−1/(m+1) is where these effects are balanced.

Formalization scope

The pool is indexed by ℕ+ and trials by Fin T; false encodes the prediction 000, true the prediction 111. IsWMI2Run is a relation between the input sequence and the master's predictions, the weights wt(i)w_t(i)wt​(i) and the active-pool sizes ltl_tlt​ at every trial boundary t∈{0,…,T}t \in \{0, \dots, T\}t∈{0,…,T}; a prediction inside the slack band is unconstrained, so the theorems hold for every run. Only active weights are constrained; the analysis uses omega, which counts inactive members at W(i)W(i)W(i). The bound mim_imi​ is any upper bound on the mistakes of AiA_iAi​. The tail hypothesis is stated with a tsum together with Summable W, and the milestone on the total weight asserts summability of ω\omegaω in its conclusion, so it cannot hold through the value 000 that Lean assigns to a divergent series. The infimum in the goal is stated as a bound for every iii, which is equivalent. Logarithms in the ratio are natural logarithms (the base cancels); the β=0\beta = 0β=0 bound uses Real.logb 2. The paper requires WWW and W^\hat WW^ to be computable; this only makes the algorithm implementable, and the formal statements hold for arbitrary real functions with the stated analytic properties.

A statement for an algorithm whose runs do not exist would be vacuous; runs of WMI2\mathrm{WMI}_2WMI2​ exist for every sequence under the hypotheses (this has been checked locally in Lean), because W^→0\hat W \to 0W^→0 and θ(m)>0\theta(m) > 0θ(m)>0 keep the active pool finite.

Needed infrastructure: finite sums over the active pool, tsum manipulations for sequences that agree with WWW outside a finite set, and real logarithm inequalities. Contributions welcome: proofs of the two milestones and the goal, and the Corollaries 4.1–4.3 as follow-up statements.

Selected references

  • N. Littlestone, M. K. Warmuth, The Weighted Majority Algorithm, Information and Computation 108(2), 212–261, 1994. https://doi.org/10.1006/inco.1994.1009
  • J. M. Barzdin, R. V. Freivalds, On the prediction of general recursive functions, Soviet Mathematics Doklady 13, 1224–1228, 1972.
  • J. M. Barzdin, R. V. Freivalds, Prognozirovanie i predel'nyi sintez effektivno perechislimykh klassov funktsii [Prediction and limit synthesis of effectively enumerable classes of functions], in Theory of Algorithms and Programs (J. M. Barzdin, ed.), Vol. 1, 101–111, Latvian State University, 1974 (in Russian).
  • N. Littlestone, M. K. Warmuth, The Weighted Majority Algorithm, Proceedings of the 30th Annual Symposium on Foundations of Computer Science, 256–261, IEEE, 1989 (cited in the journal paper as [LW89a]).
4 thms2 active usersReviewed
🏆Completed
Combinatorics·Captain: xuanji

Deterministic APSP in O(n^2.99791) time on a Word RAMResearch Paper

Motivation

All-pairs shortest paths (APSP) asks for the exact distance between every ordered pair of vertices in an nnn-vertex weighted directed graph. Floyd–Warshall solves it in O(n3)O(n^3)O(n3) time, and for decades no algorithm beat n3−δn^{3-\delta}n3−δ for any constant δ>0\delta>0δ>0 on graphs with polynomially bounded integer weights. The APSP conjecture of fine-grained complexity asserted that none exists. In 2026, Alman and Vassilevska Williams (arXiv:2610.06783) refuted it with a deterministic O(n2.99942)O(n^{2.99942})O(n2.99942) algorithm. That bound is the campaign's first entry, and it is formally proved on the platform.

This entry records the deterministic exponent 2.997912.997912.99791, obtained by tightening the accounting in the same algorithm.

Setting

The model is the campaign's fixed deterministic word RAM (foundation mission: Truly Subcubic APSP on a Word RAM). A finite program uses add, subtract and multiply modulo 2W2^W2W, indirect load and store, a sign branch, and accept or reject, on words of width W≥b(log⁡2n+1)W \ge b(\log_2 n + 1)W≥b(log2​n+1). Inputs have integer weights of absolute value at most nκn^\kappanκ for a fixed κ\kappaκ, and there are no negative cycles. The machine has no source of randomness, so randomized (Las Vegas) algorithms do not count.

Formalization target

The goal is the campaign template with the value 2.997912.997912.99791:

TrulySubcubicAPSP.APSP.SolvedInTime 2.99791,\texttt{TrulySubcubicAPSP.APSP.SolvedInTime}\ 2.99791,TrulySubcubicAPSP.APSP.SolvedInTime 2.99791,

which says there is a deterministic word-RAM program that solves APSP in O(n2.99791)O(n^{2.99791})O(n2.99791) steps.

How the bound arises

The core of the published algorithm is a data structure for thin min-plus-type products with inner dimension D=NεD = N^\varepsilonD=Nε. It has preprocessing O~(N2/DΓ)\tilde O(N^2/D^{\Gamma})O~(N2/DΓ) and queries O~(Dq)\tilde O(D^{q})O~(Dq), with parameters c=L/mc = L/mc=L/m (recursion ratio) and θ=t/m\theta = t/mθ=t/m (switch threshold). Four changes improve the saving 3−ωAPSP3 - \omega_{\mathrm{APSP}}3−ωAPSP​ from 0.000580.000580.00058 to about 0.00210.00210.0021:

  1. All-edges Exact Triangle (paper, footnote 10). APSP reduces to all-edges Exact Triangle, and then to min-plus product, by determining A⋆BA\star BA⋆B one bit at a time from ⌊A/2⌋⋆⌊B/2⌋\lfloor A/2\rfloor\star\lfloor B/2\rfloor⌊A/2⌋⋆⌊B/2⌋ with two all-edges calls per bit, followed by repeated squaring. This keeps the whole Exact Triangle saving, where the decision-version route keeps only a third of it.
  2. Exact binomial tail. With βd=(Lm−d)9L−m+d\beta_d = \binom{L}{m-d}9^{L-m+d}βd​=(m−dL​)9L−m+d, Stirling's formula gives a box-preprocessing tail D−Γ(c,θ)+o(1)D^{-\Gamma(c,\theta)+o(1)}D−Γ(c,θ)+o(1), where Γ(c,θ)=(cH(1/c)−cH((1−θ)/c)−θln⁡9)/ln⁡4\Gamma(c,\theta) = \bigl(cH(1/c) - cH((1-\theta)/c) - \theta\ln 9\bigr)/\ln 4Γ(c,θ)=(cH(1/c)−cH((1−θ)/c)−θln9)/ln4. This replaces the paper's geometric estimate γ=θln⁡((c−1)/9)/ln⁡4\gamma = \theta\ln((c-1)/9)/\ln 4γ=θln((c−1)/9)/ln4.
  3. Pruned encodings. Encoding branches whose prefix holds more than mmm copies of the distinguished branch P0P_0P0​ are discarded. This lowers the encoding exponent to Apruned(c)=(12cH(1/c)+(c−1)ln⁡3)/ln⁡4A_{\mathrm{pruned}}(c) = \bigl(\tfrac12 cH(1/c) + (c-1)\ln 3\bigr)/\ln 4Apruned​(c)=(21​cH(1/c)+(c−1)ln3)/ln4, so the thinness condition becomes ε<1/(Apruned+Γ)\varepsilon < 1/(A_{\mathrm{pruned}}+\Gamma)ε<1/(Apruned​+Γ).
  4. True middle dimension in the deterministic hashing reduction. Take prime size nun^unu and block size nvn^vnv with u+v=εu+v=\varepsilonu+v=ε, and balance preprocessing, queries and false-positive scanning. The resulting saving is
δdet⁡=εmin⁡{Γ2, 1−2q3},q(θ)=H(θ)+θln⁡9ln⁡4.\delta_{\det} = \varepsilon\min\Bigl\{\frac{\Gamma}{2},\ \frac{1-2q}{3}\Bigr\},\qquad q(\theta) = \frac{H(\theta)+\theta\ln 9}{\ln 4}.δdet​=εmin{2Γ​, 31−2q​},q(θ)=ln4H(θ)+θln9​.

The explicit parameters c=21.915c = 21.915c=21.915, θ=0.116107\theta = 0.116107θ=0.116107 and ε=0.055197\varepsilon = 0.055197ε=0.055197 satisfy the thinness condition (εmax⁡=0.0551984…\varepsilon_{\max} = 0.0551984\ldotsεmax​=0.0551984…) and give δdet⁡=0.00209524…\delta_{\det} = 0.00209524\ldotsδdet​=0.00209524…. Since 3−0.00209524<2.997913 - 0.00209524 < 2.997913−0.00209524<2.99791, the slack absorbs all polylogarithmic factors.

Significance

The randomized version of the same argument reaches about 2.996012.996012.99601 by repeating random-prime hashing. That bound is out of reach in this deterministic model. Closing the gap between deterministic and randomized collision handling is a natural next target for the campaign.

Selected references

  • J. Alman and V. Vassilevska Williams, Truly subcubic APSP (2026). https://arxiv.org/abs/2610.06783
  • T. Kopelowitz, S. Pettie and E. Porat, Higher lower bounds from the 3SUM conjecture, SODA 2016.
  • Refined exponent accounting (unpublished AI-assisted calculation, October 2026). This is the source of 2.997912.997912.99791 and has not been peer reviewed.
5 thms2 active usersReviewed
🏆Completed
CombinatoricsGraph TheoryLinear Optimization+1·Captain: mikedeng1

Approximation Algorithms for Scheduling Unrelated Parallel Machines 1: Binary Search over Rounded LP Vertices Finds a Schedule within Twice the Optimal MakespanResearch Paper

Motivation

Scheduling unrelated parallel machines to minimize the makespan, written R ∥ Cmax⁡R\,\|\,C_{\max}R∥Cmax​, is one of the basic NP-hard problems of scheduling theory. A set of jobs must each be run on one of several machines, and the time a job takes depends arbitrarily on the machine; the goal is to finish all jobs as early as possible. Before the work formalized here, the best polynomial algorithm known guaranteed only a schedule within 2m2\sqrt m2m​ times the optimum (Davis and Jaffe, 1981), a factor that grows with the number of machines mmm.

Lenstra, Shmoys and Tardos (FOCS 1987; CWI Report OS-R8714, 1987; Math. Programming 46, 1990) gave a polynomial algorithm with guarantee 222, independent of mmm. Their tool is a rounding theorem: a vertex of a natural linear-programming relaxation can be rounded to an integral schedule that exceeds each machine's budget by at most one job. The rounding theorem and the binary-search framework around it became standard material in approximation algorithms.

Setting

There are nnn jobs and m≥1m\ge 1m≥1 machines. If job jjj is scheduled on machine iii, it takes pijp_{ij}pij​ time units, a positive integer. A schedule σ\sigmaσ assigns every job jjj to one machine σ(j)\sigma(j)σ(j). The load of machine iii is ∑j:σ(j)=ipij\sum_{j:\sigma(j)=i}p_{ij}∑j:σ(j)=i​pij​, the makespan of σ\sigmaσ is the largest load, and OPT\mathrm{OPT}OPT is the minimum makespan over all schedules.

For deadlines d1,…,dmd_1,\dots,d_md1​,…,dm​ and a threshold ttt, let Ji(t)={j:pij≤t}J_i(t)=\{j: p_{ij}\le t\}Ji​(t)={j:pij​≤t} and Mj(t)={i:pij≤t}M_j(t)=\{i : p_{ij}\le t\}Mj​(t)={i:pij​≤t}. The linear program (LP) has variables xij≥0x_{ij}\ge 0xij​≥0 for j∈Ji(t)j\in J_i(t)j∈Ji​(t) and constraints

∑i∈Mj(t)xij=1(j=1,…,n),∑j∈Ji(t)pijxij≤di(i=1,…,m).\sum_{i\in M_j(t)}x_{ij}=1\quad(j=1,\dots,n),\qquad \sum_{j\in J_i(t)}p_{ij}x_{ij}\le d_i\quad(i=1,\dots,m).i∈Mj​(t)∑​xij​=1(j=1,…,n),j∈Ji​(t)∑​pij​xij​≤di​(i=1,…,m).

The integer program (IP) replaces did_idi​ by di+td_i+tdi​+t and requires xij∈{0,1}x_{ij}\in\{0,1\}xij​∈{0,1}. A vertex of (LP) is an extreme point of its feasible polytope. The support graph of a point x~\tilde xx~ is the bipartite graph on machines and jobs with an edge (i,j)(i,j)(i,j) whenever x~ij>0\tilde x_{ij}>0x~ij​>0.

A ρ\rhoρ-relaxed decision procedure answers, for a deadline ddd, either 'no' or a schedule, such that (1) every schedule it returns has makespan at most ρd\rho dρd, and (2) if it answers 'no', no schedule has makespan at most ddd. The binary search of Lemma 1 starts from the greedy schedule (each job on a machine where it runs fastest), whose makespan ttt is an upper bound uuu, with lower bound l=⌈t/m⌉l=\lceil t/m\rceill=⌈t/m⌉, queries the procedure at d=⌊(u+l)/2⌋d=\lfloor(u+l)/2\rfloord=⌊(u+l)/2⌋, moves uuu to ddd on a schedule and lll to d+1d+1d+1 on 'no', and outputs the best schedule found once l=ul=ul=u.

The LP rounding procedure answers, on deadline ddd, by solving (LP) with d1=⋯=dm=t=dd_1=\dots=d_m=t=dd1​=⋯=dm​=t=d: 'no' if it is infeasible, and otherwise a 0-1 solution of (IP) obtained by rounding a vertex x~\tilde xx~ chosen by the LP solver, supported on x~\tilde xx~.

Formalization targets

Goal: Theorem 2

For every LP solver (every rule choosing a vertex of (LP) when it is feasible), an LP rounding procedure DDD exists, and for every such DDD the output σD\sigma_DσD​ of the binary search satisfies

makespan⁡(σD)≤2⋅OPT.\operatorname{makespan}(\sigma_D)\le 2\cdot\mathrm{OPT}.makespan(σD​)≤2⋅OPT.

Milestones

  1. The support graph of every vertex of (LP) is a pseudoforest: every set SSS of machines and TTT of jobs spans at most ∣S∣+∣T∣|S|+|T|∣S∣+∣T∣ edges (§2, p. 4).
  2. In a machine–job pseudoforest, every set of jobs of degree at least 222 can be matched injectively into the machines (§2, pp. 4–5).
  3. A schedule supported on a feasible x~\tilde xx~ with at most one fractional job per machine has loads at most di+td_i+tdi​+t (§2, p. 5).
  4. Theorem 1 (Rounding Theorem): every vertex x~\tilde xx~ of (LP) has a schedule σ\sigmaσ supported on x~\tilde xx~ with
∑j:σ(j)=ipij≤di+t(i=1,…,m).\sum_{j:\sigma(j)=i}p_{ij}\le d_i+t\qquad(i=1,\dots,m).j:σ(j)=i∑​pij​≤di​+t(i=1,…,m).
  1. Lemma 1: for every ρ\rhoρ-relaxed decision procedure, the binary search outputs a schedule of makespan at most ρ⋅OPT\rho\cdot\mathrm{OPT}ρ⋅OPT.
  2. A schedule with makespan at most ddd gives a feasible point of (LP) with di=t=dd_i=t=ddi​=t=d (§3, p. 5).
  3. The LP rounding procedure is 222-relaxed (§3, pp. 5–6).

Significance

Theorem 2 gives a constant-factor approximation for R ∥ Cmax⁡R\,\|\,C_{\max}R∥Cmax​ that does not depend on mmm. The same rounding theorem drives the paper's second algorithm, a (1+ϵ)(1+\epsilon)(1+ϵ)-approximation for a fixed number of machines using polynomial space, and the paper's lower bound shows that no polynomial algorithm achieves a factor below 3/23/23/2 unless P=NP\mathrm{P}=\mathrm{NP}P=NP. The Rounding Theorem, in its later form for generalized assignment by Shmoys and Tardos (1993), is a standard tool for LP-based scheduling and assignment.

The result is proved; it has, to our knowledge, no machine-checked proof. The platform contains Matoušek and Gärtner's textbook version (MatousekLP.Scheduling.lst_two_approximation, Theorem 8.3.4 of Understanding and Using Linear Programming), which uses a different relaxation: one bound minimized parametrically over TTT, optimal solutions with linearly independent columns, and no per-machine deadlines. This mission formalizes the report's own route: deadlines did_idi​, arbitrary vertices, binary search over a relaxed decision procedure. A formal proof would also yield reusable statements about extreme points of transportation-type polytopes and matchings in pseudoforests.

Difficulty

The obvious rounding, putting each job on a machine where x~ij\tilde x_{ij}x~ij​ is largest, can overload a machine by many jobs at once: nothing in feasibility alone prevents many jobs from each placing a small fraction on the same machine. The bound di+td_i+tdi​+t requires that each machine receive at most one job that the vertex treats fractionally, and this fails for general feasible points; it holds only because x~\tilde xx~ is a vertex. The step that carries the weight is therefore a statement about the combinatorial structure of the support of an extreme point, which must be derived from the linear independence of the tight constraints, followed by a matching argument on the resulting graph. Neither step is available in Mathlib in the form needed.

On the algorithmic side, the binary search must be shown to return a schedule within ρ⋅OPT\rho\cdot\mathrm{OPT}ρ⋅OPT although the decision procedure is only approximately correct; the invariants (the lower bound stays below OPT\mathrm{OPT}OPT, the stored schedule stays within ρ\rhoρ times the upper bound) have to be tracked through a recursion.

Formalization scope

  • Machines are Fin m, jobs Fin n, processing times a matrix P : Matrix (Fin m) (Fin n) ℕ with all entries positive in Lemma 1 and Theorem 2 (the paper's model, p. 2). Loads, makespans and optimal schedules are the published MatousekLP.Scheduling.Schedule definitions applied to the real matrix (pij)(p_{ij})(pij​); OPT\mathrm{OPT}OPT is the makespan of a schedule σopt with IsOptimalSchedule.
  • (LP) is modelled on full m×nm\times nm×n real matrices with the entries pij>tp_{ij}>tpij​>t fixed to 000; this polytope is affinely isomorphic to the paper's, so vertices (Mathlib's Set.extremePoints) correspond exactly. Theorem 1 and its steps are stated for real deadlines and real t≥0t\ge 0t≥0, more general than the paper's integers; the paper's proof does not use integrality, and mission 2 of this series needs non-integral ttt.
  • Algorithmic wording not formalized. Theorem 2 states "a 2-approximation algorithm ... that runs in time bounded by a polynomial in the input size"; Lemma 1 speaks of polynomial procedures; Theorem 1 adds "this rounding can be done in polynomial time". Running time, the ellipsoid method and vertex finding are not formalized. What is formalized is the guarantee the proofs establish: the binary search, written as a Lean function, returns a schedule within ρ⋅OPT\rho\cdot\mathrm{OPT}ρ⋅OPT (Lemma 1, for every ρ\rhoρ-relaxed procedure) and within 2⋅OPT2\cdot\mathrm{OPT}2⋅OPT for every LP rounding procedure and every choice of vertex (Theorem 2).
  • Explicit constants: the factor 222 of Theorem 2 and of the 222-relaxed procedure, which comes from di+td_i+tdi​+t with di=t=dd_i=t=ddi​=t=d; the overshoot ttt of Theorem 1; the initial bounds u=u=u= greedy makespan and l=⌈u/m⌉l=\lceil u/m\rceill=⌈u/m⌉ (the paper's t/mt/mt/m, rounded up because OPT\mathrm{OPT}OPT is an integer); the query point ⌊(u+l)/2⌋\lfloor(u+l)/2\rfloor⌊(u+l)/2⌋.
  • The LP solver's choice is quantified over by a vertex selector, returning a vertex when (LP) is feasible and nothing otherwise; one always exists, since the polytope is compact.
  • Trivializing formalization ruled out. "There is a schedule with makespan at most 2⋅OPT2\cdot\mathrm{OPT}2⋅OPT" is trivially witnessed by an optimal schedule; the goal instead bounds the output of the binary search, whose every 'almost' answer must be a rounding of the solver's vertex, supported on it and feasible for (IP).
  • Needed infrastructure: extreme points of polytopes given by linear constraints and their tight-constraint rank characterization; bipartite pseudoforests and Hall-type matchings; well-founded recursion for the search. Proofs of any milestone, and reusable lemmas on extreme points of assignment polytopes, are welcome.

Selected references

  • J. K. Lenstra, D. B. Shmoys, É. Tardos, Approximation algorithms for scheduling unrelated parallel machines, CWI Report OS-R8714, Centre for Mathematics and Computer Science, Amsterdam, 1987 (the source of this mission's statements and numbering); also Proc. 28th IEEE Symposium on Foundations of Computer Science (1987) 217–224
  • J. K. Lenstra, D. B. Shmoys, É. Tardos, Approximation algorithms for scheduling unrelated parallel machines, Mathematical Programming 46 (1990) 259–271, https://doi.org/10.1007/BF01585745
  • E. Davis, J. M. Jaffe, Algorithms for scheduling tasks on unrelated processors, Journal of the ACM 28 (1981) 721–736, https://doi.org/10.1145/322276.322284
  • D. B. Shmoys, É. Tardos, An approximation algorithm for the generalized assignment problem, Mathematical Programming 62 (1993) 461–474, https://doi.org/10.1007/BF01585178
  • J. Matoušek, B. Gärtner, Understanding and Using Linear Programming, Springer, 2007, §8.3, https://doi.org/10.1007/978-3-540-30717-4
11 thms2 active usersReviewed
🏆Completed
Operations Research·Captain: mikedeng1

Flowshop and Jobshop Schedules: Complexity and Approximation 6: Concatenating Optimal Schedules of Processor Pairs Gives Finish Time within ⌈m/2⌉ Times the OptimumResearch Paper

Motivation

A flow shop is the simplest model of a production line: every job passes through the same sequence of machines in the same order. Minimizing the time at which the last job leaves the last machine (the finish time, or makespan) is easy for two machines, where Johnson's rule gives an optimal schedule in time O(nlog⁡n)O(n\log n)O(nlogn) (Johnson 1954), and NP-hard from three machines on (Garey, Johnson, Sethi 1976; Gonzalez, Sahni 1978, §1, for preemptive schedules). For three or more machines the practical question is therefore how far a fast heuristic can be from the optimum in the worst case.

Gonzalez and Sahni (1978, §2) first show that any busy schedule, one that never leaves a processor idle while a task is available for it, has finish time at most mmm times the optimum (their Lemma 10), and that the natural "longest job first" order does no better. They then give a heuristic, H, that uses Johnson's two-machine algorithm as a subroutine and has the better worst-case ratio ⌈m/2⌉\lceil m/2\rceil⌈m/2⌉ (Lemma 11). This mission formalizes that bound.

Setting

A flow shop has mmm processors P1,…,PmP_1,\dots,P_mP1​,…,Pm​ and nnn jobs. Job iii consists of mmm tasks; task jjj runs on processor PjP_jPj​ and needs processing time tj,i≥0t_{j,i}\ge 0tj,i​≥0 (zero is allowed). A non-preemptive schedule gives every task a start time sj,is_{j,i}sj,i​, and the task occupies PjP_jPj​ during [sj,i,sj,i+tj,i)[s_{j,i},s_{j,i}+t_{j,i})[sj,i​,sj,i​+tj,i​). It is feasible when all start times are nonnegative, when task j+1j+1j+1 of a job starts only after task jjj of that job has completed (sj,i+tj,i≤sj+1,is_{j,i}+t_{j,i}\le s_{j+1,i}sj,i​+tj,i​≤sj+1,i​), and when no processor runs two tasks of positive length at the same time. Its finish time FT(s)\mathrm{FT}(s)FT(s) is the latest completion time sj,i+tj,is_{j,i}+t_{j,i}sj,i​+tj,i​ (and 000 if there is no task). An optimal finish time (OFT) schedule S∗S^*S∗ is a feasible schedule of least finish time.

Heuristic H (p. 48) divides the processors into ⌈m/2⌉\lceil m/2\rceil⌈m/2⌉ groups: group ggg consists of P2g−1P_{2g-1}P2g−1​ and P2gP_{2g}P2g​, and when mmm is odd the last group is PmP_mPm​ alone. The flow shop FgF_gFg​ on group ggg has the same jobs, with task times t2g−1,i,t2g,it_{2g-1,i},t_{2g,i}t2g−1,i​,t2g,i​ only. For each group an OFT schedule R(g)R(g)R(g) of FgF_gFg​ is computed (by Johnson's algorithm), with finish time f(R(g))f(R(g))f(R(g)). The schedule SSS generated by H runs these schedules one after another: every task of group ggg starts at its time in R(g)R(g)R(g) plus the offset ∑h<gf(R(h))\sum_{h<g}f(R(h))∑h<g​f(R(h)).

Formalization targets

Goal: Lemma 11 (p. 49)

For every flow shop with mmm processors and nnn jobs, every choice of OFT schedules R(g)R(g)R(g) of the group flow shops, the schedule SSS generated by H, and every feasible non-preemptive schedule τ\tauτ of the flow shop (in particular an OFT schedule S∗S^*S∗),

FT(S)≤⌈m2⌉ FT(τ).\mathrm{FT}(S)\le\Big\lceil\frac m2\Big\rceil\,\mathrm{FT}(\tau).FT(S)≤⌈2m​⌉FT(τ).

The paper writes this as FT(S)/FT(S∗)≤⌈m/2⌉\mathrm{FT}(S)/\mathrm{FT}(S^*)\le\lceil m/2\rceilFT(S)/FT(S∗)≤⌈m/2⌉.

Milestones

  1. Every group flow shop FgF_gFg​ has an OFT schedule (p. 48; the paper obtains it with Johnson's algorithm).
  2. The concatenation of feasible group schedules is a feasible schedule of the mmm-processor flow shop (p. 48).
  3. FT(S∗)≥max⁡gf(R(g))\mathrm{FT}(S^*)\ge\max_g f(R(g))FT(S∗)≥maxg​f(R(g)) (proof of Lemma 11, p. 49).
  4. FT(S)≤∑gf(R(g))≤⌈m/2⌉max⁡gf(R(g))\mathrm{FT}(S)\le\sum_g f(R(g))\le\lceil m/2\rceil\max_g f(R(g))FT(S)≤∑g​f(R(g))≤⌈m/2⌉maxg​f(R(g)) (proof of Lemma 11, p. 49).

Significance

The result gives a polynomial-time heuristic, running in time O(mnlog⁡n)O(mn\log n)O(mnlogn), whose finish time is within a factor ⌈m/2⌉\lceil m/2\rceil⌈m/2⌉ of the optimum on every instance, half the factor mmm that every busy schedule already achieves. The paper's Example 4 (p. 49) shows that for m=3m=3m=3 the factor 2=⌈3/2⌉2=\lceil 3/2\rceil2=⌈3/2⌉ is approached, so the analysis cannot be improved in general.

Formalizing it produces a reusable, machine-checked model of the mmm-processor flow shop with non-preemptive schedules, its restriction to blocks of consecutive processors, and the concatenation of schedules of disjoint blocks. Lemma 11 has a short paper proof; to our knowledge it has no machine-checked proof. The model's careful treatment of zero task times, of odd mmm, and of the restriction of a schedule to a processor group is itself part of the value: these are the points at which an informal argument is silent.

Difficulty

The arithmetic of the bound is short; the content lies in two structural facts about a precise model: that the concatenated object is a feasible schedule of the whole flow shop, including across the boundary between consecutive groups and for a final group of a single processor, and that the optimum of the whole flow shop is at least the optimum of each group flow shop, whose first processor has no predecessor. Informal arguments are silent on exactly these points. A naive formalization that leaves the offsets free, or that does not require the R(g)R(g)R(g) to be optimal, makes the statement false; one that lets SSS be any schedule with the right restrictions makes it witnessed by S∗S^*S∗ itself.

The existence of OFT schedules for the group flow shops (milestone 1) is a separate matter: the paper takes it from Johnson's algorithm, and proving it requires an optimality argument for two-machine flow shops (or a compactness argument over finitely many processing orders).

Formalization scope

  • Representation. Processors are Fin m and jobs Fin n, both 0-based; times are real numbers. A flow shop is a matrix t : Fin m → Fin n → ℝ with t ≥ 0. A schedule is a matrix of start times. Group ggg (0-based, g : Fin ((m + 1) / 2)) contains the processors 2g2g2g and 2g+12g+12g+1 that exist, min 2 (m - 2g) of them.
  • Finish time. A fold of max with baseline 000 over all tasks; it is 000 for m=0m=0m=0 or n=0n=0n=0. The maximum of the group finish times is also a fold of max with baseline 000. No supremum over an unbounded or empty set is taken.
  • Zero task times. A zero-length task occupies no processor time (it is exempt from the non-overlap condition) but still respects the job's task order and counts in the finish time when it is placed late; optimal schedules are unaffected.
  • The optimum. "OFT schedule S∗S^*S∗" is replaced by a universally quantified feasible schedule τ\tauτ, which is stronger and needs no existence assumption for S∗S^*S∗. Optimality of R(g)R(g)R(g) is the predicate "feasible, and finish time at most that of every feasible schedule of the same group flow shop".
  • Constants. ⌈m/2⌉\lceil m/2\rceil⌈m/2⌉ is (m + 1) / 2 in N\mathbb NN, cast to R\mathbb RR; the two agree for every m≥0m\ge 0m≥0. The ratio is multiplied out, so a zero optimum does not divide by zero.
  • Not formalized. Johnson's algorithm and the running times O(nlog⁡n)O(n\log n)O(nlogn) and O(mnlog⁡n)O(mn\log n)O(mnlogn). The goal quantifies over every family of optimal group schedules, which includes the one Johnson's algorithm computes; the paper's proof uses only optimality. The preemptive comparison on p. 50 and the tightness examples are outside the mission.
  • Trivialization ruled out. The schedule SSS is a function of the R(g)R(g)R(g) with the fixed offsets ∑h<gf(R(h))\sum_{h<g}f(R(h))∑h<g​f(R(h)), and each R(g)R(g)R(g) must be optimal for its group flow shop; neither the offsets nor SSS are free.
  • Infrastructure. Elementary facts about Finset.fold max and sums over Fin; nothing beyond Mathlib. Contributions proving milestone 1 by formalizing Johnson's rule for this model are welcome and reusable.

Selected references

  • T. Gonzalez, S. Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1), 36–52, 1978. https://doi.org/10.1287/opre.26.1.36
  • S. M. Johnson, Optimal two- and three-stage production schedules with setup times included, Naval Research Logistics Quarterly 1(1), 61–68, 1954. https://doi.org/10.1002/nav.3800010110
  • M. R. Garey, D. S. Johnson, R. Sethi, The Complexity of Flowshop and Jobshop Scheduling, Mathematics of Operations Research 1(2), 117–129, 1976. https://doi.org/10.1287/moor.1.2.117
7 thms2 active usersReviewed
🏆Completed
Operations Research·Captain: mikedeng1

Flowshop and Jobshop Schedules: Complexity and Approximation 5: Sequencing Jobs by Shortest Total Processing Time Gives Mean Flow Time within m Times the OptimumResearch Paper

Motivation

Flow shops and job shops are the basic models of multi-stage production: every job passes through several machines, and each machine handles one task at a time. Gonzalez and Sahni (Operations Research 26(1), 1978) showed that minimizing the finish time of such shops is NP-complete even with preemption, and then asked how well simple heuristics do. One of the two objectives they study is the mean flow time, the average completion time of the jobs, which measures how long a job spends in the shop on average.

Their Lemma 9 analyses the most natural rule for that objective, shortest processing time first (SPT): process the jobs in order of nondecreasing total work. For a single machine SPT is optimal (Smith 1956; Conway, Maxwell and Miller, Theory of Scheduling, 1967, p. 76, which the paper cites). Lemma 9 shows that with mmm processors the same rule loses at most a factor mmm, and the paper's Example 2 shows that the factor mmm is attained in the limit.

Setting

A job shop has m≥1m\ge1m≥1 processors P1,…,PmP_1,\dots,P_mP1​,…,Pm​ and nnn jobs. Job iii is a finite sequence of tasks; each task names the processor that must process it and a processing time p≥0p\ge0p≥0. The tasks of a job are processed in their order: a task may start only after the job's previous task has completed. A flow shop is the special case in which every job has mmm tasks and its kkk-th task runs on PkP_kPk​.

A non-preemptive schedule gives every task a start time s≥0s\ge0s≥0; the task then occupies its processor during [s,s+p)[s,s+p)[s,s+p), and two distinct tasks on one processor never overlap. The finish time fi(S)f_i(S)fi​(S) of job iii in schedule SSS is the time at which all tasks of job iii have been completed, and the mean flow time is

MFT(S)=1n∑i=1nfi(S).\mathrm{MFT}(S)=\frac1n\sum_{i=1}^n f_i(S).MFT(S)=n1​i=1∑n​fi​(S).

An OMFT schedule S∗S^*S∗ is a feasible schedule of least mean flow time.

Let LiL_iLi​ be the sum of the task times of job iii. An SPT order is a listing σ(0),…,σ(n−1)\sigma(0),\dots,\sigma(n-1)σ(0),…,σ(n−1) of the jobs with Lσ(0)≤⋯≤Lσ(n−1)L_{\sigma(0)}\le\dots\le L_{\sigma(n-1)}Lσ(0)​≤⋯≤Lσ(n−1)​, ties broken arbitrarily. The SPT schedule processes the jobs in that order: each job in turn, each positive-time task starting at the later of the completion of the job's previous task and the latest completion of a task already placed on its processor. A zero-time task completes when its preceding task completes and leaves the processor available.

Formalization targets

Goal: Lemma 9

For every job shop, every SPT order σ\sigmaσ with SPT schedule SSS, and every feasible non-preemptive schedule τ\tauτ,

MFT(S)≤m⋅MFT(τ),\mathrm{MFT}(S)\le m\cdot\mathrm{MFT}(\tau),MFT(S)≤m⋅MFT(τ),

so that MFT(S)/MFT(S∗)≤m\mathrm{MFT}(S)/\mathrm{MFT}(S^*)\le mMFT(S)/MFT(S∗)≤m for an OMFT schedule S∗S^*S∗. A separate item states the same bound for flow shops.

Milestones

The milestones follow the paper's proof of Lemma 9 on p. 47:

  1. the SPT schedule is a feasible schedule;
  2. the job in position kkk of the SPT schedule finishes by ∑j≤kLσ(j)\sum_{j\le k}L_{\sigma(j)}∑j≤k​Lσ(j)​;
  3. in any feasible schedule, if i1,…,ini_1,\dots,i_ni1​,…,in​ is the order in which the jobs finish, then fik≥∑j≤kLij/mf_{i_k}\ge\sum_{j\le k}L_{i_j}/mfik​​≥∑j≤k​Lij​​/m;
  4. a prefix sum of any listing of the LiL_iLi​ is at least the corresponding prefix sum of the sorted listing;
  5. MFT(S∗)≥1n∑k=1n∑j=1kLj/m\mathrm{MFT}(S^*)\ge\frac1n\sum_{k=1}^n\sum_{j=1}^k L_j/mMFT(S∗)≥n1​∑k=1n​∑j=1k​Lj​/m.

Significance

Lemma 9 is one of the earliest performance guarantees for a shop-scheduling heuristic under a sum objective. It shows that a rule computable by one sort, O(nlog⁡n)O(n\log n)O(nlogn) plus a linear pass, is within a factor equal to the number of machines, independently of the number of jobs. This is better than the factor nnn that Lemma 8 of the same paper gives for an arbitrary busy schedule, whenever m<nm<nm<n. Example 2 of the paper shows that the factor cannot be improved for SPT. Lower bounds of the work-per-machine type used here recur in later approximation results for total completion time in shops and on parallel machines.

The result has been proved since 1978. As far as a search of the Prove2Me catalogue shows, it has not been machine-checked. This mission adds a machine-checked statement of the SPT schedule as an algorithm, not as an arbitrary schedule with a property. It also adds the guarantee for job shops with arbitrary task sequences, of which flow shops are a special case.

Difficulty

The arithmetic of the proof is short. The work is in two places. The SPT schedule is a concrete construction, a fold over jobs and tasks that updates processor availability, so the bound on its finish times has to be carried through an invariant of that construction. The lower bound on every feasible schedule needs a packing argument: tasks on one processor that complete by a given time have total length at most that time. That argument is not available in Mathlib in a form that applies here. The tempting shortcut of comparing the two schedules job by job fails: the optimal schedule need not finish jobs in SPT order, so the comparison must go through sums of sorted prefixes.

Formalization scope

  • Instance and feasibility. The job data come from the published JobShopLTAS.Core.Instance (jobs Fin n, processors Fin m, tasks Fin (μ j), real processing times ≥0\ge0≥0). The local IsPaperFeasibleSchedule requires nonnegative starts, in-job order, and no overlap of positive-time tasks on the same processor. Zero-time tasks occupy no processor interval. The paper assumes m≥1m\ge1m≥1, and the scheduling theorems carry that hypothesis.
  • Finish time and MFT. fif_ifi​ is the maximum completion time over the tasks of job iii, with baseline 000; MFT divides by nnn, and for n=0n=0n=0 both sides are 000.
  • The SPT schedule is the list schedule constructed by the heuristic, for every SPT order, so ties are broken in every possible way. Zero-time tasks do not advance processor availability. It is not "any feasible schedule whose jobs finish in SPT order", a reading under which an optimal schedule would qualify and the goal would be trivial.
  • The optimum. The paper's "Let S∗S^*S∗ be an OMFT schedule" is stated as "for every feasible non-preemptive schedule τ\tauτ". This is equivalent and does not assume that an optimum exists.
  • Ratios multiplied out. MFT(S)/MFT(S∗)≤m\mathrm{MFT}(S)/\mathrm{MFT}(S^*)\le mMFT(S)/MFT(S∗)≤m is stated as MFT(S)≤m⋅MFT(τ)\mathrm{MFT}(S)\le m\cdot\mathrm{MFT}(\tau)MFT(S)≤m⋅MFT(τ), and the proof's bounds divided by mmm are multiplied by mmm. No division by a possibly zero quantity occurs.
  • Constants. The only constant is the factor mmm, the number of processors.
  • Not formalized. The running time of SPT, the comparison with Lemma 8 and its remark "it is assumed that m<nm<nm<n" (not a hypothesis of Lemma 9), and the tightness Example 2.
  • Milestones 2 and 4 are stated for every listing σ\sigmaσ and every pair of listings; they are combinatorial facts about list schedules and sorted sums that are reusable beyond this mission. Proofs of any milestone, and a reusable packing lemma for non-overlapping intervals, are welcome.

Selected references

  • T. Gonzalez, S. Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1), 36–52, 1978. https://doi.org/10.1287/opre.26.1.36
  • R. W. Conway, W. L. Maxwell, L. W. Miller, Theory of Scheduling, Addison-Wesley, 1967.
  • W. E. Smith, Various optimizers for single-stage production, Naval Research Logistics Quarterly 3, 59–66, 1956. https://doi.org/10.1002/nav.3800030106
  • K. Jansen, R. Solis-Oba, M. Sviridenko, Makespan Minimization in Job Shops: A Linear Time Approximation Scheme, SIAM J. Discrete Math. 16(2), 288–300, 2003 (source of the job-shop definition reused here). https://doi.org/10.1137/S0895480199363908
9 thms2 active usersReviewed
🏆Completed
CombinatoricsOperations Research·Captain: mikedeng1

Flowshop and Jobshop Schedules: Complexity and Approximation 4: The 3-Partition Job Shop on Two Machines Has a Schedule of Finish Time 2tB, Preemptive or Not, Iff a 3-Partition ExistsResearch Paper

Motivation

In a job shop, each job has an ordered list of tasks, and each task must use a specified machine. A production planner may be able to interrupt a task and resume it later, yet still be unable to find a short schedule efficiently. Gonzalez and Sahni studied how the ability to preempt changes the difficulty of minimizing the time at which all jobs are complete. Their 1978 paper establishes complexity results for flow shops and job shops and then examines approximation schedules when exact optimization is difficult (Gonzalez and Sahni, 1978).

This mission concerns the paper's two-machine construction from 3-PARTITION. It is the reduction used for their claim that finding an optimal preemptive or non-preemptive finish-time schedule remains NP-complete when input size is measured by the sum of task lengths. The formal target isolates the decision equivalence proved for the constructed instance. It gives solvers a precise schedule statement to establish without conflating the scheduling theorem with the separate complexity-class argument.

Setting

A 3-PARTITION input CCC comprises an integer t≥0t\ge0t≥0, a positive integer target BBB, and s=3ts=3ts=3t positive integer sizes a1,…,asa_1,\ldots,a_sa1​,…,as​. A valid input satisfies

∑i=1sai=tB,B/4<ai<B/2(1≤i≤s).\sum_{i=1}^{s}a_i=tB,\qquad B/4<a_i<B/2\quad(1\le i\le s).i=1∑s​ai​=tB,B/4<ai​<B/2(1≤i≤s).

It has a 3-partition when the sss indices can be assigned to ttt disjoint groups, each containing exactly three indices and having total size BBB. The strict bounds rule out groups of other cardinalities at that sum and are part of the source problem, not a convenience added for formalization. When t=0t=0t=0, the input has no sizes or groups and the empty grouping is a solution.

The paper builds a job shop JS(C)JS(C)JS(C) with machines P1,P2P_1,P_2P1​,P2​ and s+1s+1s+1 jobs. For 1≤i≤s1\le i\le s1≤i≤s, job iii has a task of length aia_iai​ on P1P_1P1​, followed by a task of length aia_iai​ on P2P_2P2​. The last job, s+1s+1s+1, has 2t2t2t tasks, each of length BBB. Its tasks alternate between the machines, starting on P2P_2P2​. This last order matters: reversing it would produce a different construction. The source gives the decision threshold τ=2tB\tau=2tBτ=2tB (Lemma 7, p. 44).

A non-preemptive schedule gives each task one continuous processing interval. A preemptive schedule may divide an operation into finitely many positive-length intervals. In either case, jobs obey their task order, distinct pieces on the same machine do not overlap, and processing starts at or after time zero. Write FT(S)FT(S)FT(S) for the time at which all tasks of schedule SSS have finished. The paper allows the same job to revisit a machine, as the final job does here.

Formalization targets

Lemma 7: the constructed instance

For every valid CCC, the main goal states both the paper's preemptive equivalence and the non-preemptive form established by its two directions:

∃S preemptive for JS(C):FT(S)≤2tB  ⟺  C has a 3-partition,∃S non-preemptive for JS(C):FT(S)≤2tB  ⟺  C has a 3-partition.\begin{aligned} \exists S\text{ preemptive for }JS(C): FT(S)\le2tB &\iff C\text{ has a 3-partition},\\ \exists S\text{ non-preemptive for }JS(C): FT(S)\le2tB &\iff C\text{ has a 3-partition}. \end{aligned}∃S preemptive for JS(C):FT(S)≤2tB∃S non-preemptive for JS(C):FT(S)≤2tB​⟺C has a 3-partition,⟺C has a 3-partition.​

The milestones follow the source's proof text: the schedule supplied by a solution in Lemma 7(a), the timing forced on the final job, the exclusion of short preemptive schedules in Lemma 7(b), and the preemptive equivalence stated in the proof. The final-job milestone describes the occupied time slots of the paper's Figure 4, independently of how many adjacent pieces a formal schedule uses.

Significance

The equivalence transfers the distinction between solvable and unsolvable 3-PARTITION inputs to an exact finish-time threshold in a job shop with only two machines. It also establishes the non-preemptive decision equivalence for this construction, because a solution yields a non-preemptive schedule while an unsolvable input rules out even the more permissive preemptive schedules. These facts supply the scheduling part of the paper's strong NP-completeness claim; membership in NP is handled separately by Lemma 6 (pp. 44–45).

The result is proved in the source paper. The work proposed here is a machine-checked development of its explicit reduction equivalence and the finite-piece scheduling model needed to state it. The milestone theorems expose statements that can be reused when formalizing other preemptive scheduling reductions. The shared job-shop instance and 3-PARTITION input are already published definitions; the particular reduction instance and preemptive schedule predicate are new local definitions.

Difficulty

Preemption makes a task's processing time distributable across intervals. Merely checking that each machine has enough total capacity does not characterize feasible schedules: every job's operations must still occur in order, and pieces of different jobs must avoid one another on each machine. The converse direction must constrain every preemptive schedule that meets the threshold, not only a schedule having the visual pattern in Figure 4. A schedule can also represent one uninterrupted interval as several adjacent pieces, so piece count alone cannot express the source's timing claim.

Formalization scope

Machines are Fin 2, with P1P_1P1​ numbered 000 and P2P_2P2​ numbered 111. Jobs are Fin (3t+1); the final job is index 3t3t3t. Its zero-based operation iii uses machine 111 for even iii and machine 000 for odd iii. The definition uses the published JobShopLTAS.Core.Instance for ordered operations, machines, real processing times, and non-preemptive feasibility. It uses the published ResourceScheduling.Chain.ThreePartition for t,B,ait,B,a_it,B,ai​, validity, and solutions. Those objects have the same conventions as the paper here. The local preemptive model uses finitely many positive-length pieces per task, whose durations sum exactly to that task's processing time. The threshold is the explicit real cast of 2tB2tB2tB; no real infimum or division by a possibly zero optimum appears.

The goal is specific to the instance the paper constructs from each valid input. A free job-shop instance, a freely chosen schedule, or an extra hypothesis that the input has a solution would erase the reduction's content. Validity carries B>0B>0B>0, total tBtBtB, and both strict bounds on each aia_iai​. The case t=0t=0t=0 remains in scope: the constructed job has no tasks and its finish-time threshold is zero. All existing tasks have positive length whenever the input is valid, so the published non-preemptive predicate's treatment of zero-length tasks does not affect this mission.

The paper states “3-Partition α\alphaα preemptive JOFT with m=2m=2m=2” and connects it to NP-completeness for preemptive and non-preemptive scheduling when complexity is measured by the sum of task lengths. The Lean theorem states the proof's two decision equivalences with constant 2tB2tB2tB and machine count 222. It does not formalize α\alphaα as a polynomial-time many-one reduction, the unary task-length measure, NP-completeness, or Lemma 6's NP-membership argument. Contributions that establish the reduction statements, the schedule construction, or general finite-piece scheduling facts are within scope.

Selected references

  • Teofilo Gonzalez and Sartaj Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1), 1978, pp. 36–52. DOI: 10.1287/opre.26.1.36.
9 thms2 active usersReviewed
🏆Completed
CombinatoricsOperations Research·Captain: mikedeng1

Flowshop and Jobshop Schedules: Complexity and Approximation 1: The Partition Flow Shop on Three Machines Has a Schedule of Finish Time 2T, Preemptive or Not, Iff a Partition ExistsResearch Paper

Motivation

Shop scheduling asks how to process a set of jobs, each a sequence of tasks on prescribed machines, so that all work is completed as early as possible. The flow shop, in which every job visits the machines in the same order, is the most studied of these models in operations research. For two machines, Johnson's rule (1954) computes a schedule of minimum finish time in O(nlog⁡n)O(n\log n)O(nlogn) time, and for two machines allowing interruptions (preemption) does not help. Garey, Johnson and Sethi (Math. Oper. Res. 1976) and Brucker, Lenstra and Rinnooy Kan (Mathematisch Centrum report BW 43/75, 1975; Ann. Discrete Math. 1977) showed that the non-preemptive problem becomes NP-complete with three machines.

Gonzalez and Sahni (Operations Research, 1978) extended this picture to preemptive schedules. Their Theorem 1 shows that minimizing the finish time of a three-machine flow shop is NP-complete with or without preemption, even when every job has at most two tasks of nonzero length. When every job has only one task the problem is trivial, so this is the simplest NP-complete case of the flow-shop finish-time problem. The result explains why no exact polynomial algorithm is expected and motivates the approximation results in the second half of the same paper.

Timeline:

  • 1954: Johnson, two-machine flow shop, optimal non-preemptive rule.
  • 1975: Brucker, Lenstra, Rinnooy Kan: non-preemptive three-machine flow shop NP-complete, including the case of two nonzero tasks per job (the paper's Corollary 1, which it says "is also obtained in [1]").
  • 1976: Garey, Johnson, Sethi: non-preemptive three-machine flow shop NP-complete even when the problem size is the sum of the task lengths.
  • 1978: Gonzalez, Sahni: the preemptive three-machine flow shop is NP-complete, by a reduction from PARTITION that also covers the non-preemptive case with two nonzero tasks per job.

Setting

A flow shop has m≥1m\ge1m≥1 processors P1,…,PmP_1,\dots,P_mP1​,…,Pm​ and a finite set of jobs. Task jjj of job iii must be processed on PjP_jPj​ for tj,i≥0t_{j,i}\ge 0tj,i​≥0 time units, and it can start only after task j−1j-1j−1 of the same job is completed. Task times may be zero. The schedule starts at time 000.

A preemptive schedule gives every task a finite set of pieces (s,f)(s,f)(s,f) with 0≤s<f0\le s<f0≤s<f: the task is processed on its processor during [s,f)[s,f)[s,f). Pieces on the same processor do not overlap, the pieces of a task have total length tj,it_{j,i}tj,i​, and every piece of a task starts after every piece of the earlier tasks of the same job has ended. A non-preemptive schedule processes every task in at most one piece. For a schedule SSS, fi(S)f_i(S)fi​(S) is the time at which job iii is completed and the finish time is FT(S)=max⁡ifi(S)\mathrm{FT}(S)=\max_i f_i(S)FT(S)=maxi​fi​(S).

PARTITION. A multiset S={a1,…,an}S=\{a_1,\dots,a_n\}S={a1​,…,an​} of nonnegative integers has a partition if some set uuu of indices satisfies ∑i∈uai=12∑i=1nai\sum_{i\in u}a_i=\tfrac12\sum_{i=1}^n a_i∑i∈u​ai​=21​∑i=1n​ai​.

The instance FS. With T=∑iaiT=\sum_i a_iT=∑i​ai​, the flow shop FS\mathrm{FS}FS has m=3m=3m=3 processors and n+2n+2n+2 jobs:

t⋅,i=(ai,0,ai) (1≤i≤n),t⋅,n+1=(T/2, T, 0),t⋅,n+2=(0, T, T/2),t_{\cdot,i}=(a_i,0,a_i)\ (1\le i\le n),\qquad t_{\cdot,n+1}=(T/2,\,T,\,0),\qquad t_{\cdot,n+2}=(0,\,T,\,T/2),t⋅,i​=(ai​,0,ai​) (1≤i≤n),t⋅,n+1​=(T/2,T,0),t⋅,n+2​=(0,T,T/2),

and the threshold is τ=2T\tau=2Tτ=2T. Every job has at most two nonzero tasks.

Formalization targets

Goal: Theorem 1 (p. 38)

For every nnn and every a1,…,an∈Na_1,\dots,a_n\in\mathbb Na1​,…,an​∈N:

FS has at most two nonzero tasks per job,\mathrm{FS}\ \text{has at most two nonzero tasks per job},FS has at most two nonzero tasks per job, (∃ S′ preemptive, FT(S′)≤2T)  ⟺  S has a partition,\big(\exists\,S'\ \text{preemptive},\ \mathrm{FT}(S')\le 2T\big)\iff S\ \text{has a partition},(∃S′ preemptive, FT(S′)≤2T)⟺S has a partition, (∃ S′ non-preemptive, FT(S′)≤2T)  ⟺  S has a partition.\big(\exists\,S'\ \text{non-preemptive},\ \mathrm{FT}(S')\le 2T\big)\iff S\ \text{has a partition}.(∃S′ non-preemptive, FT(S′)≤2T)⟺S has a partition.

Milestones

  • Lemma 1(a) (p. 39): a partition of SSS yields a non-preemptive schedule of FS with FT=2T\mathrm{FT}=2TFT=2T (Figure 1).
  • Observations (i)–(ii) (p. 39): in any preemptive schedule with FT≤2T\mathrm{FT}\le 2TFT≤2T, task t1,n+1t_{1,n+1}t1,n+1​ ends by TTT and task t3,n+2t_{3,n+2}t3,n+2​ starts no earlier than TTT.
  • Lemma 1(b) (p. 39): if SSS has no partition, every preemptive schedule of FS has FT>2T\mathrm{FT}>2TFT>2T.
  • Lemma 1 (p. 38): the preemptive equivalence.
  • Corollary 1 (p. 39): the non-preemptive equivalence.

Significance

The result. The equivalence shows that a polynomial-time algorithm deciding whether a three-machine flow shop (with two nonzero tasks per job) has a schedule of finish time at most τ\tauτ, preemptive or not, would decide PARTITION in polynomial time. With membership in NP (the paper's Lemma 2) it gives NP-completeness of both versions. It also marks the boundary with the polynomial cases: m=2m=2m=2 (Johnson's rule), and jobs with a single task.

Formalizing it. The result is proved in the paper; nothing here is open. To our knowledge no machine-checked proof of this reduction exists, and the platform has no formal model of preemptive shop schedules. The mission produces one: a piece-based preemptive schedule with zero task times, which subsumes the non-preemptive case, together with the first formal NP-hardness reduction for preemptive flow shops on the platform.

Difficulty

Direction (a) asks for one explicit schedule. Direction (b) must rule out every preemptive schedule of FS, and preemption is exactly what makes this delicate: a task may be split into any finite number of pieces placed anywhere on its processor, so the naive intuition that a failed partition leaves "unusable gaps" is no longer evident, since pieces of different jobs can be interleaved to fill gaps. A correct argument must therefore be an accounting of processor time over the pieces, valid for any number and position of pieces, and it must treat zero-length tasks, which occupy no processor time but still delay the next task of their job. Finally, the non-preemptive equivalence is not a formal consequence of the preemptive one alone: it uses that (a) produces a non-preemptive schedule and that (b) holds for all preemptive schedules, which include the non-preemptive ones.

Formalization scope

  • Processors are Fin 3 (P1,P2,P3P_1,P_2,P_3P1​,P2​,P3​ = 0, 1, 2), jobs of FS are Fin n ⊕ Fin 2 (Sum.inr 0 is job n+1n+1n+1, Sum.inr 1 is job n+2n+2n+2). Task times are real numbers; the PARTITION data are a : Fin n → ℕ, and "has a partition" is 2∑i∈uai=∑iai2\sum_{i\in u}a_i=\sum_i a_i2∑i∈u​ai​=∑i​ai​ in N\mathbb NN.
  • A schedule is a Finset of pieces (s,f)(s,f)(s,f) per task with the four conditions of the Setting. Non-preemptive means at most one piece per task. Zero tasks have no pieces and occupy no processor time. fi(S)f_i(S)fi​(S) and FT(S)\mathrm{FT}(S)FT(S) are maxima with baseline 000.
  • Explicit constants: T=∑iaiT=\sum_i a_iT=∑i​ai​, the times T/2T/2T/2 and TTT of jobs n+1,n+2n+1,n+2n+1,n+2, and the threshold τ=2T\tau=2Tτ=2T, as on p. 39. Lemma 1(a) states finish time exactly 2T2T2T, as the paper does.
  • Not formalized: "NP-complete", the reducibility relation "α\alphaα", membership in NP (Lemma 2, p. 40) and the polynomial computability of FS from SSS. The paper states Theorem 1, Lemma 1 and Corollary 1 as complexity claims. Their proofs establish the equivalences above for the constructed instance, and those equivalences are what is formalized.
  • No trivializing reading is admitted: the statements concern the specific instance FS built from aaa, not an arbitrary flow shop, and the schedule model rules out overlapping pieces and out-of-order tasks while still allowing zero tasks. A sorry-free check confirms that Figure 1 is a valid non-preemptive schedule of FS for S={1,1}S=\{1,1\}S={1,1}.
  • Reusable beyond this mission: the flow-shop model with preemptive pieces, and PARTITION. Proofs of the milestones and a proof of the goal from them are welcome.

Selected references

  • T. Gonzalez, S. Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1), 36–52, 1978. https://doi.org/10.1287/opre.26.1.36
  • M. R. Garey, D. S. Johnson, R. Sethi, The Complexity of Flowshop and Jobshop Scheduling, Mathematics of Operations Research 1(2), 117–129, 1976. https://doi.org/10.1287/moor.1.2.117
  • S. M. Johnson, Optimal two- and three-stage production schedules with setup times included, Naval Research Logistics Quarterly 1(1), 61–68, 1954. https://doi.org/10.1002/nav.3800010110
  • P. Brucker, J. K. Lenstra, A. H. G. Rinnooy Kan, Complexity of Machine Scheduling Problems, Mathematisch Centrum report BW 43/75, 1975; Annals of Discrete Mathematics 1, 343–362, 1977. https://doi.org/10.1016/S0167-5060(08)70743-X
  • R. M. Karp, Reducibility among Combinatorial Problems, in Complexity of Computer Computations, Plenum, 85–103, 1972. https://doi.org/10.1007/978-1-4684-2001-2_9
9 thms2 active usersReviewed
PreviousPage 6 of 10Next

Get started

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

About Prove2Me

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

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me