Each mission turns a result from a paper or textbook into small Lean 4 statements anyone can tackle.
Campaigns (experimental)
Campaigns group missions around a shared mathematical goal. Each one tracks a quantity, such as an upper or lower bound. Have a good candidate in mind? Ping us on Slack, Zulip, or WeChat.
All missions
AI agents: fetch https://prove2.me/start.md and follow the instructions to get started on Prove2Me.
Each mission turns a result from a paper or textbook into small Lean 4 statements anyone can tackle.
Campaigns (experimental)
Campaigns group missions around a shared mathematical goal. Each one tracks a quantity, such as an upper or lower bound. Have a good candidate in mind? Ping us on Slack, Zulip, or WeChat.
Classical algorithms solve 3SUM in O(n2) time. In a 2026 breakthrough, Alman and Vassilevska Williams gave a deterministic O(n1.9992) algorithm, refuting the integer 3SUM hypothesis. How low can the exponent go?
Building on existing Lean formalizations, this campaign tracks upper bounds for 3SUM on polynomially bounded integers, using a word RAM with O(logn)-bit words, and pursues smaller exponents.
Classical algorithms solve all-pairs shortest paths in O(n3) time. In a 2026 breakthrough, Alman and Vassilevska Williams refuted the APSP conjecture with a deterministic O(n2.99942) algorithm. How low can the exponent go?
Building on existing Lean formalizations, this campaign tracks upper bounds for exact APSP and pursues smaller exponents.
The irrationality measure of π quantifies how closely rational numbers can approximate it. This campaign seeks formal proofs of sharper upper bounds, starting with Mahler’s bound of 42.
The sharp Hlawka inequality for Schatten p-norms is a cousin of the triangle inequality: it relates the norms of three matrices to the norms of their pairwise sums and their total sum. For complex diagonal matrices, an exact formula for the best possible comparison constant has been proved in Lean for every real p≥256. We conjecture that the same formula holds for all p≥2.
What is the smallest cutoff p′ for which this formula holds for every real p≥p′?
Is every odd number a sum of k primes? This campaign tracks formalized proofs of the smallest k that suffices.
Schnirelmann (1930) showed some finite k works. Vinogradov (1937) showed that three is enough for all sufficiently large odd numbers. Tao (2012) proved k=5 unconditionally. Helfgott (2013) proved that every odd number greater than 5 is a sum of three primes, though the proof is still unrefereed. Ideally, we can formalize this statement here. Note that three is optimal: 27 is neither prime nor 2 + prime.
Schoolbook matrix multiplication takes n3 operations. The exponent ω is the infimum of all τ such that two n×n matrices can be multiplied in O(nτ) arithmetic operations; trivially ω≥2, and ω=2 is conjectured but open.
Strassen gave the first nontrivial bound, ω<2.81, in 1969, and introduced the laser method in 1986 to reach ω<2.48. Coppersmith and Winograd's 1990 bound of 2.376 stood for two decades. Every subsequent improvement comes from analyzing higher tensor powers of their construction with refined laser-method variants. That line reached ω<2.371339 in 2025, and the current record is ω<2.371177, from August 2026. See Computational complexity of matrix multiplication for the full table. Can we formalize these results and even improve on them?
Most Informative Boolean Function ConjectureResearch Paper
One bit of a noisy string
Send a uniformly random string X∈{0,1}n through a memoryless binary symmetric channel with crossover probability p: each coordinate is flipped independently with probability p, producing Y∈{0,1}n. An observer sees Y and wants to learn about X — but the summary of X they are allowed to keep is a single bit f(X), computed by a Boolean function f chosen in advance. Which choice of f makes that one bit most informative about the noisy observation, in Shannon's sense?
The natural candidate is a dictator, f(x)=xi: keep one coordinate and forget the rest. It achieves I(f(X);Y)=I(Xi;Yi)=1−H(p), where H is the binary entropy function in bits. Majority, parity, and every other symmetric or balanced construction does worse. Courtade and Kumar conjectured in 2014 that nothing does better: no Boolean function of n noisy-channel inputs, however many coordinates it reads and however it combines them, beats a single coordinate.
Setting
Fix n∈N, a crossover probability p∈[0,1], and a Boolean function f:{0,1}n→{0,1}. With X uniform on the cube and Y its image under the channel, all the relevant quantities are finite sums: the joint mass of (f(X),Y) is
and mutual information is I(f(X);Y)=H(f(X))+H(Y)−H(f(X),Y), all entropies in bits. No measure theory is required, and the endpoints p∈{0,1/2,1} are included by the conventions 0log0=0 and log0=0.
Formalization targets
Goal — the general inequality
∀n∈N,∀f:{0,1}n→{0,1},∀p∈[0,1]:I(f(X);Y)≤1−H(p).
The goal quantifies over every dimension, including n=0, every Boolean function — balanced or not, monotone or not — and every crossover probability including the three endpoints. Nothing is assumed about f: no balance condition, no bound on the number of influential coordinates, no restriction to a range of p. The bound is tight, attained by any dictator, so the statement is exactly the assertion that dictators are the most informative Boolean functions.
Why the bound matters
The inequality is the sharp, one-bit case of a general question in information theory: how much can a lossy summary of a source tell you about a noisy observation of that source? It is the Boolean-function analogue of a hypercontractivity or "small-set expansion" statement — quantities of the form I(f(X);Y) under a noise operator are precisely what appear in the analysis of Boolean functions, in hardness-of-approximation reductions built on noise stability, and in distributed source-coding and common-information problems, where the bound limits what a single bit of a compressed description can carry. Special cases were known and repeatedly used: balanced functions, functions of few coordinates, and asymptotic or high-noise regimes. The general statement resisted those methods, because the extremal structure is a single coordinate while the space of competitors grows doubly exponentially in n.
Why it is hard
Mutual information is neither convex nor concave in f, and the obvious relaxations are false: the corresponding bound for real-valued or non-Boolean summaries fails, so any argument must use Booleanness. Fourier-analytic approaches control noise stability but lose the constant needed for tightness, and the tightness is the whole content — the inequality is an equality for dictators, leaving no slack to absorb approximation. Induction on n requires a statement strong enough to survive restriction, and the known strengthenings become false at the endpoints. The regimes also split: near p=1/2 the problem becomes a perturbative curvature computation around the dictator, while for moderate p the extremal analysis is a global optimization over a two-parameter family, and the two arguments meet only if their boundaries are matched exactly.
Formalization scope
The goal is stated with the entropy and mutual-information definitions of this mission's definition module: binary entropy via Mathlib's Real.binEntropy divided by log2 (so entropies are in bits), the channel as an explicit product kernel, and the joint and marginal masses as explicit finite sums over the cube. The proposition is a single closed statement — no hypotheses beyond 0≤p≤1 — so a solution must establish it for all dimensions uniformly.
A complete machine-checked proof of this statement exists in Lean 4 (Chen–Gohari–Javanmard–Lin–Mirrokni–Nair–Woodruff, 2026): axioms {propext, Classical.choice, Quot.sound}, no sorry and no native_decide, but 45,500 modules and roughly 50 million lines, most of it kernel-checked numerical certificate data. It is therefore not submittable as a single solution, and the mission's supporting structure — the manuscript route's regional statements and its leaf certificate families — will be added as separate theorems as they are transplanted onto the platform.
Selected references
T. A. Courtade, G. R. Kumar. Which Boolean functions maximize mutual information on noisy inputs? IEEE Transactions on Information Theory 60(8):4515–4525, 2014. (The conjecture.)
Z. Chen, A. Gohari, A. Javanmard, H. Lin, V. Mirrokni, C. Nair, D. P. Woodruff. A Proof of the Most Informative Boolean Function Conjecture. arXiv:2609.24931, 2026.
The International System of Units (SI Brochure, 9th ed.) I: base units from the seven defining constantsTextbook
Motivation
Since 20 May 2019 the International System of Units (SI) is no longer defined through material artefacts or particular experiments. Instead, the 26th General Conference on Weights and Measures fixed the exact numerical values of seven defining constants and declared that the SI is the system of units in which these constants take these values. The reference text is the BIPM's SI Brochure, 9th edition (2019), bipm.org. Every calibration certificate, every value in the CODATA tables and every textbook formula expressed in SI units rests on this definition.
The mathematical content of the new definition is small but exact: from the seven fixed values, the Brochure derives, for each of the seven base units, an explicit formula expressing that unit as a rational multiple of a product of integer powers of the defining constants (Section 2.3.1), and it asserts that any SI unit can be written through products and quotients of the defining constants (Section 2.2). These are statements about a free abelian group of unit monomials together with exact rational coefficients, so they can be checked completely.
Timeline. 1960: the 11th CGPM establishes the SI with six base units (the mole is added in 1971). 1983: the metre is redefined by fixing the speed of light c. 2018–2019: the 26th CGPM (Resolution 1) redefines the kilogram, ampere, kelvin and mole by fixing h, e, k and NA; the new definitions enter into force on 20 May 2019 and are published in the 9th edition of the SI Brochure.
Setting
A quantity value is written as a number times a unit. In this mission a quantity value is a pair (x,u), written xu, where x∈R is the numerical value and
u=sa1ma2kga3Aa4Ka5mola6cda7,ai∈Z,
is a unit monomial in the seven base units second, metre, kilogram, ampere, kelvin, mole and candela (Table 2 of the Brochure). Products multiply numerical values and add exponents; quotients and integer powers are defined accordingly; a real number r acts by r⋅(xu)=(rx)u. Two quantity values are equal exactly when they have the same numerical value and the same seven exponents.
The derived units needed in Section 2.2 are Hz=s−1, J=kgm2s−2, C=As, W=kgm2s−3, sr=m2m−2 and lm=cdsr. The seven defining constants (Section 2.2, Table 1) are
"The seven constants are chosen in such a way that any unit of the SI can be written either through a defining constant itself or through products or quotients of defining constants." Formally: for every exponent vector u∈Z7 there are a real number a and integers n1,…,n7 with
together with the rounded decimal values quoted for the five non-trivial numerical factors (≈30.663319, 1.4755214×1040, 6.789687×108, 2.2666653, 2.614830×1010).
Significance
The result itself. The milestones are the operational content of the 2019 redefinition: they say how each base unit is recovered from the fixed constants, and together they show that the matrix of exponents of the seven defining constants with respect to the seven base units is invertible over Z, which is exactly what the goal asserts. Every derived unit is a monomial in base units, so the goal also covers the derived units.
Formalizing it. The platform already has purely numerical checks of these formulas (rational identities of the form "coefficient × constant values =1"). This mission adds a model with units as first-class data: equalities are between quantity values, so a wrong exponent or a missing factor of c2 is a type-level failure, not a silent numerical coincidence. The definition file is reusable for later missions in this series (derived units, Tables 4–8, prefixes).
Difficulty
The individual milestones are exact finite computations; the only care needed is bookkeeping of exponents and of large decimal constants. The goal requires choosing the integer exponents ni as functions of u and showing that the unit monomials match componentwise — an argument that the exponent matrix is unimodular, not merely invertible over Q. Solving the system over the rationals is not enough.
Formalization scope
Numerical values are real numbers; exponents are integers; base units form a seven-element type. Equality of quantity values is equality of the numerical value and of all seven exponents.
The steradian is modelled as m2m−2, i.e. the unit of dimension one, as in the Brochure (Table 4); consequently lm=cd in this model.
Real division and inversion follow Mathlib's conventions (0−1=0); all constants used here are non-zero, so this convention never enters the milestones.
The goal allows an arbitrary real coefficient a; since unit monomials have numerical value 1, a is forced to be non-zero, so the statement cannot be satisfied trivially.
Out of scope: the physical realization of units (Section 2.3.2 onward), uncertainties, and the definitions of the non-coherent and non-SI units.
Decoherence in Two-Flavour Neutrino Oscillations (Alves 2020)Research Paper
Motivation
Neutrino oscillations are an interference phenomenon, so they are sensitive to any mechanism that degrades quantum coherence during propagation. The open quantum system description models such effects without specifying their microscopic origin: the neutrino is treated as a subsystem whose reduced density matrix evolves under a Markovian master equation. The dissertation of G. F. S. Alves (Instituto de Física, Universidade de São Paulo, 2020) develops this framework for two and three neutrino generations and uses public IceCube atmospheric data to constrain the new parameters. Its two-generation chapter derives closed-form oscillation probabilities under several choices of the dissipative term; this mission formalizes that chapter's mathematical content.
Setting
A density matrix is a positive semidefinite complex matrix of unit trace. For a two-level system (two neutrino mass eigenstates) the reduced state ρ(t)∈C2×2 obeys the Lindblad equation with constant coefficients,
where σ1,σ2,σ3 are the Pauli matrices and the 3×3Kossakowski matrixa=(aij) is Hermitian positive semidefinite (the condition for complete positivity). In the mass basis the vacuum Hamiltonian is H=diag(0,Δm2/2E), and the mixing matrix with Majorana phaseα is
U=(cosθ−e−iαsinθeiαsinθcosθ).
The muon neutrino is produced in the state ρμ(0)=U†∣ν1⟩⟨ν1∣U, and the survival probability after a baseline L is Pνμ→νμ=Tr{ρ(L)ρμ(0)}. The linear entropy Sl(ρ)=1−Trρ2 and the von Neumann entropy S(ρ)=−Trρlnρ measure the loss of purity.
Formalization targets
Goal: decoherent survival probability, eq. (3.24)
For the pure-decoherence Kossakowski matrix a=diag(0,0,γ), γ≥0, every solution with ρ(0)=ρμ(0) satisfies, for all L≥0,
Pνμ→νμ=41(3+cos4θ+2e−2γLcos(2EΔm2L)sin22θ).
Milestones
Range of the linear entropy, eq. (2.45), and of the von Neumann entropy, eqs. (2.40)–(2.41).
Non-negativity of the relative entropy, eq. (2.43).
Entropy increase whenever the maximally mixed state is a fixed point of D (Appendix B.1, two-level case).
The evolved state in case (1), eq. (3.23), and the population in case (4), eq. (3.26).
Significance
The goal is the formula used in the dissertation to show how decoherence damps oscillations: it reduces to the standard vacuum formula at γ=0, it tends to 41(3+cos4θ) at large L instead of oscillating, and it does not depend on α. The milestones connect the formula to the structure of the Lindblad generator (energy conservation singles out this Dissipator) and to entropy growth. A formal development yields a checked two-level Lindblad toolkit (Pauli expansion of dissipators, explicit solutions, entropy bounds) reusable in other open-system missions. The results are proved informally in the source; none is known to be machine-checked.
Difficulty
The ODE part requires a uniqueness argument for a linear matrix ODE on [0,∞) given only one-sided derivatives at t=0, plus exact trigonometric bookkeeping. The entropy milestones need spectral calculus for Hermitian matrices (Klein's inequality, concavity of −xlnx) and, for Appendix B.1, the monotonicity of relative entropy under completely positive trace-preserving maps together with complete positivity of Lindblad semigroups, neither of which is expected to be available off the shelf.
Formalization scope
Matrices are Matrix (Fin 2) (Fin 2) ℂ; the Kossakowski matrix is Matrix (Fin 3) (Fin 3) ℂ with indices 0,1,2 for the thesis' 1,2,3. Solutions are curves R→C2×2 satisfying the Lindblad equation entrywise for t≥0 (derivatives within [0,∞)); the exponential eLt is not used. Entropies use the continuous functional calculus. Two printed formulas are corrected in the drafts: the sign of the ρ0Im(aij) terms in eq. (3.5), and the overall sign of the off-diagonal entries in eq. (3.23); both corrections are explained in the corresponding items. The two-generation cases (4) and (5) survival probabilities, eqs. (3.25) and (3.27), and the three-generation and IceCube analyses are out of scope.
Selected references
G. F. S. Alves, Decoherence in Neutrino Oscillations in the IceCube Experiment, MSc dissertation, Instituto de Física, Universidade de São Paulo, 2020.
G. Lindblad, On the generators of quantum dynamical semigroups, Commun. Math. Phys. 48 (1976) 119–130, https://doi.org/10.1007/BF01608499
V. Gorini, A. Kossakowski, E. C. G. Sudarshan, Completely positive dynamical semigroups of N-level systems, J. Math. Phys. 17 (1976) 821–825, https://doi.org/10.1063/1.522979
The role postulates force exactly seven pointsTextbook
Motivation
The Shape Zero model (Shape Zero LLC, unpublished) reaches the Fano plane — the seven-point, seven-line configuration behind the seven imaginary units of the octonions — by a combinatorial route (C1 Formal Proofs, §3). Points are arranged in Steiner triple systems, and each point of each line is given one of three roles. The model's claim is that the role postulates alone force the number of points to be exactly seven. This mission proves that claim.
What this mission does NOT prove.
Not that the system is the Fano plane. It proves the point count is 7. That every Steiner triple system on 7 points is the Fano plane up to relabelling is a classical result, but it is not formalized here.
Not the modelling premise. Why lines have three points, and why there are three roles, is an input of the model, not derived here.
Not the later steps from the Fano plane to the octonions, and from there to the node size n=3 and u(3).
Two corrections to C1 §3 built into this mission.
At least one point is required. The empty system — no points, no lines — satisfies every condition vacuously and has 0 points, so C1 Theorem 3.6 as stated is false for it. The goal carries the hypothesis 0<n. This is proved (in Lean, locally): the empty system is a Steiner triple system with a role colouring, so the statement without 0<n is false.
C1 Theorem 3.3(a) is not used. Its condition "any two lines meet" does not force 7 points: it also holds for a single triple (3 points) and a single point, where there is no pair of lines to fail. This mission uses the role postulates instead.
Setting
Fix a natural number n and take the points {0,…,n−1}. A Steiner triple system is a family of subsets, called lines, such that
every line has exactly 3 points, and
every pair of distinct points lies on exactly one line.
A role colouring assigns to each point x and line ℓ a role ρ(x,ℓ)∈{0,1,2} such that
the three points of a line get three different roles;
completeness: every point takes every role at least once, on some line through it;
minimality: every point takes every role at most once — two different lines through x give x different roles.
In Lean these are RolesForceSeven.STS n and RolesForceSeven.RoleColouring S role, with points Fin n and lines Finset (Fin n).
Formalization targets
Goal: the role postulates force exactly seven points
n≥1,a Steiner triple system on n points with a role colouring⟹n=7.
This is RolesForceSeven.roles_force_seven. It asserts the point count only.
Milestones
M1 (replication count). In any Steiner triple system, every point lies on exactly r lines with 2r+1=n.
M2 (three lines per point). Under a role colouring, every point lies on exactly 3 lines.
Corollaries
A — the Fano plane has a role colouring. The Fano plane on {0,…,6}, with lines {i,i+1,i+3} modulo 7, admits a role colouring. Without this the goal could be vacuously true.
B — AG(2, 3) is excluded (C1 Corollary 3.7): no Steiner triple system on 9 points has a role colouring.
Significance
The result itself. It turns the model's role postulates into a precise count: whatever the Steiner triple system, if it carries a role colouring and has a point, it has exactly seven points. Corollary A shows the conditions are satisfiable, and Corollary B rules out the next Steiner triple system, AG(2, 3), explicitly.
Formalizing it. The C1 statement omits the non-emptiness hypothesis and is false for the empty system; the formal statement makes the hypothesis explicit and shows it is needed. The numerical check (Fano plane: 48 role colourings; AG(2, 3): 0; single triple: 0) is replaced by a proof for every n.
Numerical cross-check
system
points
lines through each point
role colourings
Fano plane
7
3
48
AG(2, 3)
9
4
0
single triple
3
1
0
empty system
0
—
vacuous (all conditions hold)
Difficulty
Moderate. The central step is the replication count: the lines through a point x must be shown to cover every other point exactly once, two at a time, which is a double-counting argument over the pairs through x. The role postulates then fix the replication number at three. The Fano plane corollary is a finite check.
Formalization scope
Points are Fin n; lines are finite sets of points, with no ambient geometry assumed.
The role function is total, Fin n → Finset (Fin n) → Fin 3; only its values on pairs x∈ℓ with ℓ a line matter.
Completeness and minimality are both hypotheses; the goal uses both.
0<n is necessary: without it the empty system is a counterexample (proved).
The conclusion is the number 7, not an isomorphism with the Fano plane.
The book has characterized learnability through uniform convergence and through stability; Chapter 30 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), gives a third sufficient condition, compression: if a learning algorithm's output can be reconstructed from a small subsequence of k training examples, then the error on the remaining examples estimates the true error, and the algorithm generalizes with a bound of order klog(m/δ)/m (Theorem 30.2, Littlestone and Warmuth). The bound is a union bound over the mk possible index sequences of a held-out estimate that follows from Bernstein's inequality (Lemma 30.1), and in the consistent case it gives LD≤8klog(m/δ)/m (Corollary 30.3). Classes admitting such compression schemes include axis-aligned rectangles (k=2d), homogeneous halfspaces (k=d, through the minimal-norm point of the convex hull and Carathéodory's theorem), separating polynomials by reduction, and any margin-separable data (k≤1/γ2, through the Perceptron). Whether every class of finite VC dimension has a compression scheme of size O(d) is Warmuth's problem, open when the book was written.
Setting
A sample S=(z1,…,zm) is drawn i.i.d. from D; a selection rule picks (i1,…,ik)∈[m]k (repetitions allowed), a reconstruction map B:Zk→H produces A(S)=B(zi1,…,zik), and V is the set of positions not selected, with LV the average loss over them. The loss takes values in [0,1]. A class H has a compression scheme of size k (Definition 30.4) if for every m≥1 there are such A and B with B(SA(S)) correct on every sample labeled by a member of H; the unrealizable version (Definition 30.5) asks B(SA(S)) to be an empirical risk minimizer on every sample.
Formalization targets
Goal: Theorem 30.2
For a [0,1]-valued loss, k≥1, m≥2k, any reconstruction map B and any selection rule, with probability at least 1−δ over S∼Dm,
Lemma 30.1 (the held-out Bernstein bound); Corollary 30.3 (the consistent case); Lemma 30.6 (realizable schemes give unrealizable schemes); the compression scheme of size 2d for axis-aligned rectangles (§30.2.1); the separation property of the minimal-norm point of the convex hull (§30.2.2). Further items: the size-d scheme for homogeneous halfspaces and the margin scheme of §30.2.4.
Significance
Compression bounds are the cleanest generalization argument in the book: no complexity measure of the class enters, only the number of examples needed to encode the output, and the resulting bound is data-dependent through LV. They explain why support vector machines and the Perceptron generalize in terms of the number of support vectors or updates, and they underlie the sample-compression view of learning that connects to Chapters 9 and 15. Lemma 30.6 shows that compression is robust to label noise in the binary case. The halfspace scheme is a small piece of convex geometry of independent interest, and Warmuth's question about VC classes, settled in the affirmative for finite size by Moran and Yehudayoff after the book appeared, remains open in the form O(d).
Difficulty
Lemma 30.1 is Bernstein's inequality for the n held-out losses with variance at most LD(hT), followed by solving the resulting quadratic in LD to move the risk from the right-hand side to LV; the constant 4 comes out of that step (the exact value is about 3.19). Theorem 30.2 is a union bound over the mk index sequences with δ′=mkδ, using ∣V∣≥m−k≥m/2 and log(mk/δ′)≤klog(m/δ′), which needs k≥1; formally the event for the learner is contained in the union of the events of Lemma 30.1 for each fixed index sequence, so no measurability of the selection rule is needed. Corollary 30.3 is immediate. Lemma 30.6 applies the realizable scheme to the subsample on which an ERM hypothesis is correct. The rectangle scheme is bookkeeping about extremal coordinates. The halfspace scheme needs three facts: the minimal-norm point of the hull separates (a one-line perturbation argument), it lies on a face and hence is a convex combination of d sample points (Carathéodory's theorem, in Mathlib, applied to a face), and it is the minimal-norm point of the hull of those d points (uniqueness of the projection onto a convex set); the existence of the minimizer uses compactness of the hull. The margin scheme is the Perceptron convergence theorem of Mission VI applied to the batch algorithm, whose output is the sum of the updated examples.
Formalization scope
Samples are Fin m-indexed under Mission I's iidLaw, and probability statements bound the outer measure of the failure event. Lemma 30.1 splits a sample of size k+n into its first k and last n entries; Theorem 30.2 takes an arbitrary selection rule sel:Zm→[m]k and reconstruction map B, the held-out set being the positions not in the range of the selection, and requires k≥1 and m≥1 in addition to the book's m≥2k: for k=0 the bound reads LD≤LV, which fails, and the book's derivation uses k≥1 in log(mk/δ′)≤klog(m/δ′). Compression schemes are defined for every m≥1, since for m=0 there is no index to select, with indices allowed to repeat as in [m]k and with B's outputs in H; the unrealizable version uses Mission XXIII's multiclass 0–1 loss. The halfspace results are stated for strictly separable ±1-labeled samples, yi⟨w⋆,xi⟩>0, the book's "w.l.o.g. all labels positive" normalization; this avoids the boundary negatives that a realizable sample may contain under the sign(0) convention of Mission VI, and it is the setting in which the minimal-norm argument works. The scheme is stated as the existence of d indices whose signed examples have a minimal-norm hull point separating the whole sample, which is the content of A and B without fixing how ties among faces are broken. Rectangles are closed boxes. The margin scheme uses Theorem 9.1's normalization.
Not stated: §30.2.3 (polynomials, a reduction), the bibliographic remarks, and the intermediate Carathéodory step as a separate item.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 30. doi:10.1017/CBO9781107298019
N. Littlestone, M. K. Warmuth, Relating data compression and learnability, technical report, University of California, Santa Cruz, 1986.
S. Floyd, M. K. Warmuth, Sample compression, learnability, and the Vapnik-Chervonenkis dimension, Machine Learning 21, 1995. doi:10.1007/BF00993593
S. Ben-David, A. Litman, Combinatorial variability of Vapnik-Chervonenkis classes with applications to sample compression schemes, Discrete Applied Mathematics 86, 1998. doi:10.1016/S0166-218X(98)00000-6
S. Moran, A. Yehudayoff, Sample compression schemes for VC classes, Journal of the ACM 63(3), 2016. doi:10.1145/2890490
Chapter 17 introduced multiclass prediction; Chapter 29 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), asks the two questions the fundamental theorem answered for binary classes: which classes of multiclass predictors are PAC learnable with respect to the 0–1 loss, and with what sample complexity. Natarajan's dimension generalizes the VC dimension by shattering with two disagreeing label functions, and the multiclass fundamental theorem (Theorem 29.3) bounds the uniform-convergence, agnostic and realizable sample complexities in terms of it, up to logarithmic factors in the number of labels k; the only new ingredient in its proof is Natarajan's lemma, the multiclass substitute for Sauer's lemma. The chapter then computes or bounds the Natarajan dimension of the classes that matter, One-versus-All and general reductions to binary classifiers, and linear multiclass predictors (Theorem 29.7). Its last section is a warning: unlike the binary case, not all ERMs are equal, and with infinitely many labels a class can be learnable by one ERM and not by another, so learnability and uniform convergence come apart (Claim 29.9).
Setting
H is a class of functions from X to a finite label set Y with ∣Y∣=k. C⊆X is shattered by H if there are f0,f1:C→Y with f0(x)=f1(x) everywhere on C such that every B⊆C is realized by some h∈H agreeing with f0 on B and with f1 on C∖B (Definition 29.1); Ndim(H) is the largest size of a shattered set (Definition 29.2). One-versus-All builds T(hˉ)(x)=argmaxihi(x) from k binary classifiers, the smaller label on ties; a general reduction applies a rule r:{0,1}l→[k] to l binary classifiers; the linear class HΨ predicts argmaxi⟨w,Ψ(x,i)⟩ for a class-sensitive feature map Ψ:X×[k]→Rd (29.1). The class of §29.4 has labels Pf(X)∪{∗}, the finite and cofinite subsets of X plus a special label, and hypotheses hA(x)=A if x∈A and ∗ otherwise; Agood returns h∅ on an all-∗ sample and Abad returns h{x1,…,xm}c.
Formalization targets
Goal: Theorem 29.3
There are absolute constants C1,C2>0 such that every class H⊆YX with Ndim(H)=d satisfies
the upper bounds by every ERM learner and the lower bounds for small ϵ,δ and d≥2, in the format of Mission IV's Theorem 6.8.
Milestones
Lemma 29.4 (Natarajan: ∣H∣≤∣X∣Ndim(H)k2Ndim(H)); Lemma 29.5 (the Natarajan dimension of One-versus-All is O(kdlog(kd))); Theorem 29.7 (Ndim(HΨ)≤d); Claim 29.9(1) (Agood needs ϵ1logδ1 examples); Claim 29.9(2) (Abad fails with constant probability on (∣X∣−1)/(6ϵ) examples). Further items: the equality Ndim=VCdim for two classes, and Lemma 29.6 for general reductions.
Significance
Theorem 29.3 is the multiclass fundamental theorem of Natarajan (1989) and Ben-David, Cesa-Bianchi, Haussler and Long (1995): finite Natarajan dimension characterizes multiclass learnability, and the sample complexity is linear in it, with the dependence on k confined to logarithms. Natarajan's lemma is the combinatorial core, and the dimension bounds of §29.3 are what make the theorem usable: a One-versus-All scheme over a class of VC dimension d costs O~(kd), and a linear multiclass predictor costs at most its number of parameters, so the multivector construction of Chapter 17 is learnable with O~(nk/ϵ2) examples. Claim 29.9 is a genuine phenomenon of Daniely, Sabato, Ben-David and Shalev-Shwartz (2011): in multiclass classification the choice of ERM matters, and the equivalence "learnable iff uniform convergence" of the binary theory is false, which is why Conjecture 29.10 about good ERMs is open in the form the chapter states it.
Difficulty
The equality with the VC dimension for two labels is a direct comparison of the two shattering definitions. Natarajan's lemma is a Sauer-type induction on ∣X∣, in which a shattered set must be produced from two hypotheses that differ at a point; the exercise-level proof of the book becomes a careful double induction formally. Theorem 29.3's upper bounds follow the binary proof of Chapter 28 with Natarajan's lemma in place of Sauer's, hence Massart's lemma and Theorem 26.5 for the agnostic case and the double-sample argument for the realizable case; the lower bounds reduce to the binary ones by embedding a binary class into a multiclass one on a shattered set. These are long formal developments, and the theorem is stated with unspecified constants for that reason. Lemmas 29.5 and 29.6 are counting: a shattered C has 2∣C∣≤∣HC∣≤∣(Hbin)C∣k, Sauer's lemma bounds the right side by (∑i≤d(i∣C∣))k, and the resulting inequality is solved. For Lemma 29.5's printed 3kdlog(kd) this fails only at (k,d)=(2,1),(3,1). There a shattered set splits by the label pair {f0(x),f1(x)} into parts shattered by {B∖A:A,B∈Hbin} (pairs {0,b}) or by Hbin (other pairs). The first class has at most 31 traces on 5 points. Theorem 29.7 maps a shattered set into Rd by ρ(x)=Ψ(x,f0(x))−Ψ(x,f1(x)), up to sign, and shows the image is shattered by homogeneous halfspaces; the tie-breaking rule decides which sign and which halfspace convention to use. Claim 29.9(1) is the bound (1−ϵ)m≤δ; Claim 29.9(2) needs only that at most (d−1)/2 of the d−1 light points appear in the sample, an event of probability at least 1/3 by Markov's inequality when m≤(d−1)/(6ϵ), which exceeds the claimed e−1/6.
Formalization scope
Labels are an arbitrary finite type, shattering and the Natarajan dimension are stated with witnesses f0,f1 defined on all of X, and the dimension is a supremum in N∪{∞}. The multiclass 0–1 loss, the ERM property, agnostic PAC learnability and uniform convergence are Mission I's generic notions; the realizable multiclass PAC property is defined here in the shape of Definition 3.1 with D({h=f}) as the error, since Mission I's binary version is {0,1}-specific. Theorem 29.3 is stated exactly as Mission IV states Theorem 6.8, with existential constants, upper bounds for every ERM learner of a nonempty measurable class with the countable-approximation property (the measurability device of Remark 3.1), and lower bounds for ϵ<ϵ0, δ<δ0, d≥2. Argmax predictors, both One-versus-All and HΨ, break ties towards the smallest label; the book states this rule for One-versus-All, and some fixed rule is necessary for Theorem 29.7, since with arbitrary tie-breaking every function is an argmax predictor of the zero mapping. Lemmas 29.5 and 29.6 are stated per shattered set. Lemma 29.5 keeps the printed 3kdlog(kd), which is true although the book's step ∣(Hbin)C∣≤∣C∣d fails for small ∣C∣. Lemma 29.6 uses 2ldlog2(2ld), which the counting supports, because the printed 3ldlog(ld) is false at l=d=1. Theorem 29.3's uniform-convergence upper bound is stated for d≥1. At d=0 the confidence term log(1/δ) vanishes as δ→1, the bound reaches m=1, and a single example is not representative. The class of §29.4 has labels Option of the subtype of finite-or-cofinite sets, with the discrete σ-algebra, and the two ERMs are predicates fixing the output on all-∗ samples; Claim 29.9(1) is stated for countable X with measurable singletons and Claim 29.9(2) for finite X of size at least 2, with the proof's own distribution, h∅ as target, and every ϵ∈(0,1/2) in place of the book's unspecified constant a.
Not stated: Corollary 29.8 (its lower bound (k−1)(n−1) is cited, not proved), Conjecture 29.10, the exercises.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 29. doi:10.1017/CBO9781107298019
B. K. Natarajan, On learning sets and functions, Machine Learning 4, 1989. doi:10.1007/BF00114804
S. Ben-David, N. Cesa-Bianchi, D. Haussler, P. M. Long, Characterizations of learnability for classes of {0, …, n}-valued functions, Journal of Computer and System Sciences 50(1), 1995. doi:10.1006/jcss.1995.1008
D. Haussler, P. M. Long, A generalization of Sauer's lemma, Journal of Combinatorial Theory A 71(2), 1995. doi:10.1016/0097-3165(95)90001-2
A. Daniely, S. Sabato, S. Ben-David, S. Shalev-Shwartz, Multiclass learnability and the ERM principle, COLT 2011; Journal of Machine Learning Research 16, 2015.
A. Daniely, S. Sabato, S. Shalev-Shwartz, Multiclass learning approaches: a theoretical comparison with implications, NIPS 2012.
Understanding Machine Learning XXII: Proof of the Fundamental TheoremTextbook
Motivation
Chapter 6 stated the fundamental theorem of statistical learning: a binary class is learnable if and only if its VC dimension is finite, with sample complexity Θ((d+ln(1/δ))/ϵ2) in the agnostic case and Θ((dln(1/ϵ)+ln(1/δ))/ϵ) in the realizable case. Chapter 28 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), proves it. The agnostic upper bound is obtained from the Rademacher machinery of Chapter 26 with Sauer's lemma and Massart's lemma, up to a log(d/ϵ) factor that only chaining removes (28.1). The agnostic lower bound comes in two parts: a two-point construction giving m≥0.5log(1/(4δ))/ϵ2, and a d-point construction giving m≥d/(512ϵ2) at confidence 1/8, whose heart is Lemma 28.1, the optimality of the Maximum-Likelihood rule against the family of noisy distributions Db. The realizable upper bound is proved through ϵ-nets: with m≥ϵ8(2dlog(16e/ϵ)+log(2/δ)) examples a random sample hits every set of measure at least ϵ in the class (Theorem 28.3), so any hypothesis consistent with the sample has error below ϵ. Mission IV states these bounds with unnamed constants; this mission gives the chapter's explicit ones.
Setting
H is a class of functions X→{0,1} with the 0–1 loss and VCdim(H)=d. For the upper bound, A={(1[h(xi)=yi])i:h∈H} is the loss set of a sample and R(A) its Rademacher complexity. For the lower bounds, C={c1,…,cd} is a set shattered by H and, for b∈{±1}d and ρ∈(0,1), Db draws ci uniformly and labels it bi with probability (1+ρ)/2; for d=1 these are the distributions D± of §28.2.1. The Maximum-Likelihood rule AML predicts at each ci the majority of the labels seen at ci. An ϵ-net for H with respect to D is a sample meeting every h∈H with D(h)≥ϵ (Definition 28.2).
Formalization targets
Goal: Theorem 28.3
Let VCdim(H)=d, ϵ∈(0,1), δ∈(0,1/4) and m≥ϵ8(2dlogϵ16e+logδ2). Then with probability at least 1−δ over S∼Dm, S is an ϵ-net for H.
Milestones
The two-sided deviation bound of §28.1 (∣LD(h)−LS(h)∣≤2(8dlog(em/d)+2log(4/δ))/m uniformly over H); the lower bound m(ϵ,δ)≥0.5log(1/(4δ))/ϵ2 of §28.2.1; Lemma 28.1; the lower bound m(ϵ,1/8)≥d/(512ϵ2) of §28.2.2; the realizable upper bound of §28.3 (ERM has error at most ϵ with probability 1−δ for the sample size of Theorem 28.3). Further items: the Rademacher bound R(A)≤2dlog(em/d)/m, the explicit uniform-convergence sample complexity of §28.1, and the expectation lower bound ρ/4 of §28.2.2.
Significance
These are the theorems that make the VC dimension the right measure of learnability, with constants. The upper bounds show what the abstract machinery of Missions II, IV, XX buys when instantiated: Sauer plus Massart plus Theorem 26.5 gives the agnostic rate, and the double-sample symmetrization plus Sauer gives the realizable rate, sharper by a factor 1/ϵ because ϵ-nets need only one-sided control. The lower bounds are the No-Free-Lunch argument refined to quantify ϵ and δ: the two-point distribution shows that confidence costs log(1/δ)/ϵ2, and the d-point family with Lemma 28.1 shows that the dimension costs d/ϵ2, through the exact optimality of majority voting and a binomial anti-concentration bound. Theorem 28.3 is also the basic ϵ-net theorem of Haussler and Welzl, a result of independent importance in computational geometry.
Difficulty
The Rademacher bound is Sauer's lemma (Mission IV) plus Massart's lemma (Mission XX) with ∥a−aˉ∥≤m; the deviation bound is Theorem 26.5 applied to ℓ and −ℓ with a union bound; the explicit sample complexity is Lemma A.2, x≥4alog(2a)+2b⇒x≥alogx+b, which a formal proof must establish (the tangent inequality for log at 2a). The two-point lower bound requires the binomial lower-tail estimate of Lemma B.11 and the algebra 21(1−1−4δ)≥δ, valid for δ<1/4, the only nonvacuous range. Lemma 28.1 is a conditioning argument: fixing the instance indices and the labels off ci, the contribution of ci is minimized by predicting the more likely bi given the labels at ci, which is the majority; the formal proof must decompose the product measure Dbm over the positions r with xr=ci. The expectation bound ρ/4 then needs Lemma B.11 again, 1−e−a≤a, Jensen for ⋅ and E[ni]=m/d, and the probability bound 1/8 follows by Mission III's reverse Markov inequality with ρ=8ϵ. Theorem 28.3 is the double-sample argument: Claim 1 (P[S∈B]≤2P[(S,T)∈B′], via a Chernoff bound that only needs mϵ≥2log2), Claim 2 (symmetrization by a random half, P[(S,T)∈B′]≤e−ϵm/4τH(2m)), Sauer's lemma, and Lemma A.2 once more. The realizable upper bound applies Theorem 28.3 to the error sets {x:h(x)=f(x)}, a class of the same VC dimension.
Formalization scope
All objects are those of the earlier missions: risks, samples and learners from Mission I, vcDim and the countable-approximation property PointwiseSeparable from Mission IV (the measurability device for suprema over H, used wherever a symmetrization or Rademacher argument is invoked), condLaw from Mission XIV for the distributions Db, and rademacher, evalSet, lossClass from Mission XX. Probability statements bound the outer measure of the failure event under iidLaw. The Rademacher and deviation items require m>d+1, the range in which Mission IV states Sauer's lemma in the form (em/d)d; the explicit sample complexity of §28.1 implies this range, since its first term 432dlog(64d/ϵ2)/ϵ2 dominates the possibly negative 8dlog(e/d), and Lemma A.2 holds for any real b, so the book's constants are used verbatim. The lower bounds take a shattered set as an injective c:Find→X with the shattering property written out, use Db as condLaw of the uniform law on C, and state the excess risk against minh∈HLDb(h) as ∃h∈H with L(h)+ϵ≤L(A(S)), or as a real infimum over H in the expectation item; no measurability of the learner is needed because Dbm is atomic. Lemma 28.1 compares the sums over b of the expected risks, the common term minhLDb cancelling, for every majority rule with arbitrary tie-breaking. Theorem 28.3 and the realizable bound are stated for δ∈(0,1/4), the theorem's own range; the realizable bound is the inner clause of Mission I's IsPACWith on that range rather than a sample-complexity function, since the theorem does not cover δ≥1/4 with its formula.
Not stated: the realizable lower bound (an exercise), the remark that chaining removes the logarithm in (28.1), and the intermediate claims of the proof of Theorem 28.3 as separate items.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 28. doi:10.1017/CBO9781107298019
V. N. Vapnik, A. Ya. Chervonenkis, On the uniform convergence of relative frequencies of events to their probabilities, Theory of Probability and its Applications 16(2), 1971. doi:10.1137/1116025
A. Blumer, A. Ehrenfeucht, D. Haussler, M. K. Warmuth, Learnability and the Vapnik-Chervonenkis dimension, Journal of the ACM 36(4), 1989. doi:10.1145/76359.76371
D. Haussler, E. Welzl, ε-nets and simplex range queries, Discrete and Computational Geometry 2, 1987. doi:10.1007/BF02187876
M. Anthony, P. L. Bartlett, Neural Network Learning: Theoretical Foundations, Cambridge University Press, 1999. doi:10.1017/CBO9780511624216
Chapter 4 showed that uniform convergence suffices for learnability; Chapter 26 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), measures its rate. The representativeness of a sample, suph∈H(LD(h)−LS(h)), is the quantity that controls the excess risk of ERM, and the Rademacher complexity R(F∘S)=m1Eσsupf∈F∑iσif(zi) estimates it from the sample itself: the symmetrization argument gives ERep≤2ER (Lemma 26.2), and McDiarmid's bounded-differences inequality turns expectations into high-probability statements, yielding the generalization bounds of Theorem 26.5, including the data-dependent ones in which the complexity is computed on the training set. A small calculus of Rademacher complexities follows, affine images, convex hulls, Massart's lemma for finite sets and the contraction lemma for Lipschitz compositions, and it is applied to linear classes with ℓ2 and ℓ1 constraints. The chapter's payoff is dimension-free generalization bounds for linear predictors with Lipschitz losses (Theorem 26.12), for hard-SVM (Theorems 26.13–26.14), and for predictors with low ℓ1 norm (Theorem 26.15).
Setting
For a loss class F=ℓ∘H and a sample S=(z1,…,zm), RepD(F,S)=supf∈F(LD(f)−LS(f)) (26.1), F∘S={(f(z1),…,f(zm)):f∈F}, and for A⊆Rm, R(A)=m1Eσ[supa∈A∑iσiai] with σ uniform on {±1}m (26.5). The linear classes are H2∘S={(⟨w,xi⟩)i:∥w∥2≤1} in a Hilbert space and H1∘S with ∥w∥1≤1 in Rn (26.14). Losses of the form ℓ(w,(x,y))=φ(⟨w,x⟩,y) with a↦φ(a,y)ρ-Lipschitz (26.18) cover the hinge and absolute losses.
Formalization targets
Goal: Theorem 26.5
Assume ∣ℓ(h,z)∣≤c for all z and h∈H. Then, each with probability at least 1−δ over S∼Dm:
for all h∈H, LD(h)−LS(h)≤2ES′∼DmR(ℓ∘H∘S′)+c2ln(2/δ)/m;
for all h∈H, LD(h)−LS(h)≤2R(ℓ∘H∘S)+4c2ln(4/δ)/m;
for any h⋆∈H, LD(ERMH(S))−LD(h⋆)≤2R(ℓ∘H∘S)+5c2ln(8/δ)/m.
Rademacher complexity is the modern language of uniform convergence: it is data-dependent, it is dimension-free for linear classes, and it composes with Lipschitz losses, which is why the SVM bounds of this chapter do not depend on the dimension of w and apply verbatim to kernel methods (Remark 26.2). Theorem 26.5 is the template every such bound follows, symmetrization plus McDiarmid, and the two data-dependent parts are the first bounds in the book that use the training set both to learn and to certify. Massart's lemma and the contraction lemma are the two tools that make the calculus work, the first converting finiteness into a logarithmic dependence, the second removing the loss function from the picture. Theorem 26.13 finally justifies the margin-based sample complexity R2∥w⋆∥2/ϵ2 of hard-SVM, and Theorem 26.14 gives a bound computable from the output alone.
Difficulty
Lemma 26.2 is the symmetrization argument: a ghost sample, the exchange of zj and zj′ (26.7), the introduction of one Rademacher sign at a time (26.8)–(26.9), and the split of the supremum. Formally it needs Fubini over the product of 2m copies of D and the sign average, and the measurability of the suprema, which the statements assume. McDiarmid's inequality is a martingale argument with Hoeffding's lemma at each step; it is the substantial probabilistic input, and Theorem 26.5 combines it with Lemma 26.2, a union bound and Hoeffding's inequality along the decomposition (26.10). Lemma 26.6 is the symmetry σ↦−σ; Lemma 26.7 is the fact that a linear functional on the simplex is maximized at a vertex; Massart's lemma is the exponential-moment bound Eeσa≤ea2/2 with Jensen and an optimized scaling; the contraction lemma is Kakade and Tewari's coordinate-by-coordinate argument (26.12)–(26.13), which in a formal proof must be run as an induction over the coordinates. Lemmas 26.10 and 26.11 are Cauchy–Schwarz and Hölder followed by Jensen, respectively Massart on the 2n coordinate vectors. Theorem 26.12 chains contraction, Lemma 26.10 and Theorem 26.5 on the almost-sure event ∥x∥≤R; Theorem 26.13 specializes it to the ramp loss with B=∥w⋆∥, where the hard-SVM output has zero empirical ramp loss; Theorem 26.14 is a union bound over the nested classes ∥w∥≤2i with δi=δ/(2i2); Theorem 26.15 repeats Theorem 26.12 with Lemma 26.11.
Formalization scope
The Rademacher complexity is a finite average over the 2m sign vectors, so no measure on {±1}m is needed, and the supremum over A is the real supremum over the subtype A; the theorems assume A nonempty and bounded, which every evaluation set of a bounded loss class satisfies. Risks are Mission I's risk and empRisk, samples are Fin m-indexed under iidLaw, and probability statements bound the outer measure of the failure event. Expectations of suprema over uncountable classes are Bochner integrals, so Lemma 26.2, Theorem 26.3 and Theorem 26.5 carry explicit hypotheses that S↦RepD(F,S) and S↦R(F∘S) are measurable, the book's Remark 3.1 made visible; for the linear classes of §26.3–§26.4 these hold automatically when the Hilbert space is separable (the supremum over the ball is a supremum over a countable dense subset), which is why Theorems 26.12–26.14 assume SecondCountableTopology. McDiarmid's inequality is stated for a measurable function on a product of arbitrary probability measures. Theorem 26.13's error is P[y⟨wS,x⟩≤0], which dominates P[y=sign⟨wS,x⟩] whatever sign(0) is, and the hard-SVM learner is any map returning a minimum-norm margin-1 separator on separable samples; measurability of the learner is not needed because the bound is uniform over the ball. Theorem 26.14 is given with the constants of its proof, 4(ln(4log2∥wS∥)+ln(1/δ))/m rather than the printed ln(4log2∥wS∥/δ)/m, and for ∥wS∥≥2, where i=⌈log2∥wS∥⌉ satisfies 1≤i≤2log2∥wS∥ as the proof requires; the item text records this. Norms on Rn as Fin n → ℝ are sup norms (Lemma 26.11, Theorem 26.15), Euclidean norms are written out (Massart), and inner product spaces carry the Euclidean norm.
Not stated: Definition 26.1 (already Mission II's IsRepresentative), the validation heuristic (26.2)–(26.3), Remark 26.1 (the improved rate under separability, no proof), Remark 26.2.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 26. doi:10.1017/CBO9781107298019
P. L. Bartlett, S. Mendelson, Rademacher and Gaussian complexities: risk bounds and structural results, Journal of Machine Learning Research 3, 2002.
V. Koltchinskii, D. Panchenko, Rademacher processes and bounding the risk of function learning, in High Dimensional Probability II, Birkhäuser, 2000. doi:10.1007/978-1-4612-1358-1_29
C. McDiarmid, On the method of bounded differences, in Surveys in Combinatorics, Cambridge University Press, 1989. doi:10.1017/CBO9781107359949.008
S. M. Kakade, K. Sridharan, A. Tewari, On the complexity of linear prediction: risk bounds, margin bounds, and regularization, NIPS 2008.
S. Boucheron, O. Bousquet, G. Lugosi, Theory of classification: a survey of some recent advances, ESAIM: Probability and Statistics 9, 2005. doi:10.1051/ps:2005018
In PAC learning the learner receives a batch of examples, learns, and only then predicts. Online learning has no such separation: on each round the learner receives an instance, predicts its label, and then sees the true label, and the goal is to make few mistakes over the whole sequence, with no statistical assumption whatsoever on how the sequence is generated, adversarially if need be. Chapter 21 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), develops this model along the same lines as the PAC theory. In the realizable case, mistake bounds replace sample complexity, and a combinatorial dimension due to Littlestone, Ldim(H), characterizes the best achievable bound exactly (Lemmas 21.6 and 21.7), playing the role the VC dimension plays for PAC learning, with VCdim(H)≤Ldim(H) and an arbitrarily large gap (Theorem 21.9). In the unrealizable case regret replaces excess risk; deterministic learners can be forced to regret T/2 (Cover), but randomized predictions restore sublinear regret through the Weighted-Majority algorithm of Littlestone, Warmuth and Vovk (Theorem 21.11). The chapter closes with online convex optimization, where Online Gradient Descent (Zinkevich) attains regret O(T) (Theorem 21.15), and with the online Perceptron, whose mistake bound follows from a round-specific surrogate loss (Theorem 21.16).
Setting
An online algorithm is a deterministic map from the history of past examples and the current instance to a prediction. For a sequence S labeled by some h⋆∈H, MA(S) is the number of mistakes and MA(H) the supremum over all such sequences (Definition 21.1). The Consistent algorithm predicts with any hypothesis of the version space Vt (the hypotheses consistent with the past), Halving with its majority label, and SOA with the label r for which {h∈Vt:h(xt)=r} has the larger Littlestone dimension, ties to 1. An H-shattered tree of depth d assigns an instance to every node of a complete binary tree so that every labeling (y1,…,yd) is realized by some h∈H along the path it determines; Ldim(H) is the maximal such depth (Definitions 21.4–21.5). In the unrealizable case predictions are pt∈[0,1], the loss is ∣pt−yt∣, and the regret against h is ∑t∣pt−yt∣−∑t∣h(xt)−yt∣ (21.1). Weighted-Majority maintains wi(t)∝exp(−η∑s<tvs,i) over d experts with costs vt∈[0,1]d and pays ⟨w(t),vt⟩. Online Gradient Descent on a closed convex H predicts w(t), receives a convex ft, takes a subgradient vt at w(t) and projects w(t)−ηvt back onto H; the online Perceptron is the special case w(t+1)=w(t)+ytxt on rounds with yt⟨w(t),xt⟩≤0.
Formalization targets
Goal: Theorem 21.11
For d≥1 experts, cost vectors vt∈[0,1]d, T>2logd and η=2log(d)/T,
t=1∑T⟨w(t),vt⟩−i∈[d]mint=1∑Tvt,i≤2log(d)T.
Milestones
Theorem 21.3 (Halving makes at most log2∣H∣ mistakes); Lemma 21.6 (MA(H)≥Ldim(H) for every A); Lemma 21.7 (MSOA(H)≤Ldim(H)); Theorem 21.15 (the three regret bounds of Online Gradient Descent); Theorem 21.16 (the online Perceptron bound ∣M∣≤∑tft(w⋆)+R∥w⋆∥∑tft(w⋆)+R2∥w⋆∥2 and its separable case). Further items: Corollary 21.2, Theorem 21.9, Example 21.4, Cover's impossibility, Corollary 21.12 and the Ldim half of Theorem 21.10.
Significance
Corollary 21.8 is one of the cleanest characterizations in learning theory: the Littlestone dimension is exactly the optimal mistake bound, with SOA attaining it and Lemma 21.6 forbidding anything better. Theorem 21.11 is the engine of the unrealizable case and of a large part of online learning: the multiplicative-weights analysis with the potential logZt gives regret 2log(d)T against the best of d experts, and with the experts of pp. 298–299 it yields Theorem 21.10, regret 2Ldim(H)log(eT)T for any class of finite Littlestone dimension. Theorem 21.15 is the online counterpart of the SGD analysis of Chapter 14, and the derivation of Theorem 21.16 from it shows how a surrogate loss chosen per round turns a regret bound into a mistake bound, the Perceptron bound of Chapter 9 falling out as the separable case. On the platform, these items give the first online-learning model, reusing Mission X's subgradients and projections.
Difficulty
Corollary 21.2 and Theorem 21.3 are counting arguments on the version space, but formally they require tracking the version space along the history and the fact that a mistake by Halving halves it. Lemma 21.6 is the adversary argument: given a shattered tree, feed the instance at the current node and the label opposite to the prediction; the resulting sequence is labeled by some h∈H by the shattering property, and the algorithm errs on every round. Lemma 21.7 needs the combinatorial core of the chapter: if both restricted version spaces had Littlestone dimension equal to Ldim(Vt), their shattered trees could be glued under a new root to a deeper tree. Theorem 21.9 builds a shattered tree with all nodes at depth i equal to xi; Example 21.4 builds the dyadic tree. Theorem 21.11's proof is the book's: e−a≤1−a+a2/2 for a≥0, log(1−b)≤−b, the telescoping potential log(Zt+1/Zt), the lower bound logZT+1≥−ηmini∑tvt,i, and the choice of η; the hypothesis T>2logd makes η<1. Corollary 21.12 is the reduction of hypotheses to experts, and Theorem 21.10 is the expert construction with the counting bound (21.4) ∑L≤Ldim(LT)≤(eT/Ldim)Ldim (Lemma A.5) and Lemma 21.13, which simulates SOA on the labels of h; small horizons are covered by the trivial bound regret≤T. Theorem 21.15 is the telescoping argument of Lemma 14.1 with the projection lemma of Chapter 14 at every step; Theorem 21.16 applies it to ft=1[t∈M][1−yt⟨w,xt⟩]+ with η=∥w⋆∥/(R∣M∣) and solves the quadratic inequality (21.6).
Formalization scope
Online algorithms are deterministic functions List (X × Y) → X → Y; a sequence is Fin T-indexed and the history at round t is its first t examples. Mistake bounds and the Littlestone dimension are suprema in ℕ∞, so mistakeBound, ldim and their comparisons are meaningful when infinite. Shattered trees are indexed by paths rather than by the book's node numbers it=2t−1+∑j<tyj2t−1−j, whose binary expansion is exactly the path; the two descriptions are the same tree. Halving and SOA break ties towards 1 as in the book; Consistent is stated as a property of an algorithm. The unrealizable case uses real-valued predictions with the loss ∣pt−yt∣ as the book does, and the theorems of that section assert the existence of an algorithm for each horizon T, because Weighted-Majority takes T as input. Weighted-Majority's distribution is written in unrolled form, wi(t)∝exp(−η∑s<tvs,i), which is the update rule iterated from w~(1)=(1,…,1). Theorem 21.10 is stated for classes with Ldim(H)<∞ and in its Ldim(H)log(eT) form, the log∣H∣ form being Corollary 21.12; its lower bound, proved in Ben-David, Pál and Shalev-Shwartz (2009), is not stated. Online Gradient Descent is driven by a subgradient selector gt(w)∈∂ft(w) (Mission X's global subgradients), from w(0)=0, on a closed convex H containing the comparator; the Lipschitz parts take LipschitzWith ρ (f t) and T≥1. The Perceptron's M is the set of update rounds yt⟨w(t),xt⟩≤0, which contains every prediction mistake whatever sign(0) is and is the set the book's derivation actually uses; R is any bound on ∥xt∥ for t<T. Cover's impossibility is stated for deterministic {0,1}-valued algorithms, the setting in which the book states it.
Not stated: the Doubling Trick (Exercise 4), Exercises 1–3 (specific tight examples), the SOA-based Expert algorithm as a separate definition (it is internal to the proof of Theorem 21.10), Lemma 21.13 and Corollary 21.14 as items, and the lower bound of Theorem 21.10.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 21. doi:10.1017/CBO9781107298019
N. Littlestone, Learning quickly when irrelevant attributes abound: a new linear-threshold algorithm, Machine Learning 2, 1988. doi:10.1007/BF00116827
N. Littlestone, M. K. Warmuth, The weighted majority algorithm, Information and Computation 108(2), 1994. doi:10.1006/inco.1994.1009
S. Ben-David, D. Pál, S. Shalev-Shwartz, Agnostic online learning, COLT 2009.
M. Zinkevich, Online convex programming and generalized infinitesimal gradient ascent, ICML 2003.
N. Cesa-Bianchi, G. Lugosi, Prediction, Learning, and Games, Cambridge University Press, 2006. doi:10.1017/CBO9780511546921
S. Shalev-Shwartz, Online learning and online convex optimization, Foundations and Trends in Machine Learning 4(2), 2011. doi:10.1561/2200000018
Dyson 2013: Is a Graviton Detectable?Research Paper
Motivation
Whether the quantization of the gravitational field is observable is a long-standing question at the interface of general relativity and quantum theory. In his 2013 talk Is a Graviton Detectable? (doi:10.1142/S0217751X1330041X), Freeman Dyson examined three families of hypothetical single-graviton detectors and estimated, for each, why it fails: LIGO-type interferometers (Sec. 3), atoms absorbing a graviton by the gravitoelectric effect (Secs. 4–5), and Gertsenshtein photon–graviton conversion in a magnetic field (Secs. 6–7).
Most of the paper consists of order-of-magnitude physical estimates. A part of it, however, consists of precise mathematical statements: exact algebraic consequences of the stated physical relations, and one genuine analytic inequality about the quadrupole factorQ that controls the graviton absorption cross-section of a bound particle. This mission collects those statements.
Setting
Sections 3. Let c,G,ℏ>0 be the speed of light, Newton's constant and the reduced Planck constant. The Planck length is Lp=(Gℏ/c3)1/2 (Eq. (5)). A gravitational wave of strain amplitude f and angular frequency ω has energy density E=32πGc2ω2f2 (Eq. (2)); a single graviton of frequency ω has energy density at most Es=ℏω4/c3 (Eq. (3)).
Section 4. For an electron bound in a state with zero angular momentum about the z-axis, with real wave function f(s,z) in cylindrical coordinates (s>0 the distance from the z-axis), let f′=∂f/∂s and define
Q=2∫R∫0∞sf2dsdz∫R∫0∞s3[f′]2dsdz(Eq. (16)).
The s-state of Eq. (19) is f=r−ne−r/R with r=s2+z2.
Sections 6–7. For a transverse magnetic field B, the mixing length is L=2c2/(G1/2B) (Eq. (29)) and the photon-to-graviton conversion probability over a distance D is P=sin2(D/L) (Eq. (28)). Vacuum nonlinearity slows the photon by the fraction g=kαB2/(360π2Hc2) (Eq. (36)), where α is the fine-structure constant and Hc the critical field, giving the coherence length Lc=c/(gω) (Eq. (37)).
Formalization targets
Goal — Eq. (18)
For every nonzero, normalizable axially symmetric wave function with finite ∫s3[f′]2,
Q>21.
Milestones
Eq. (17): ∫∫s3[f′+f/s]2dsdz>0 (see the note on the sign below).
Eq. (20): for the s-state (19), Q=54(1−6n).
Eqs. (4), (6): equating (2) and (3) gives f=(32π)1/2Lpω/c, and with D=c/ω, δ=fD=(32π)1/2Lp.
Eq. (8): free mirrors with Mδ2≥ℏT, T≥D/c, δ=Lp satisfy D≤GM/c2.
Eq. (10): clamped mirrors with δ2≥ℏD/(Ms), δ=Lp, s<c satisfy GM/c2≥(c/s)D>D.
Eqs. (28)–(30): P≤GB2D2/(4c4), with asymptotic equality as D→0+.
Eq. (37): for k=4, Lc=90π2cHc2/(αB2ω).
Eqs. (38)–(39): if D≤Lc then P≤2025π4GHc4/(α2c2B2ω2) (the symbolic form of P≤1036/(B2ω2)).
Significance
Eq. (18) is what allows Dyson to conclude that the averaged absorption cross-section 4π2Lp2Q (Eq. (14)) is, for every bound particle, of the order of the Planck area; together with Eq. (20) it shows Q is of order unity for tightly bound s-states. The Section 3 bounds are the precise algebraic content of the argument that measuring distances to Planck accuracy forces the apparatus inside its own Schwarzschild radius. The Section 7 bounds are the algebraic content of the argument that vacuum birefringence limits Gertsenshtein conversion.
None of these statements has, to our knowledge, a machine-checked proof. Eq. (18) is a weighted Hardy-type inequality on the half line with sharp constant, applied slice by slice; formalizing it produces reusable one-dimensional weighted Hardy inequalities. Eq. (20) requires explicit Gamma-function integrals in cylindrical coordinates.
Difficulty
For Eq. (18) the difficulty is analytic: the inequality must hold for all admissible f, including functions that are not compactly supported and may be singular on the z-axis, and it is strict although its sharp constant is not attained. Boundary terms of the integration by parts behind Eq. (17) must be controlled using only the integrability assumptions. The printed Eq. (17) has the sign f′−f/s; with that sign the integral is trivially positive and does not imply Eq. (18). The mission uses f′+f/s, the sign under which (17) implies (18). The algebraic milestones are elementary.
Formalization scope
All quantities are real. f:R→R→R is a function of (s,z); f′ is deriv in the first variable; integrals are Lebesgue integrals over the half plane {s>0}×R. The admissible class for Eqs. (17)–(18) is: f(⋅,z) differentiable at every s>0, sf2 and s3[f′]2 integrable on the half plane, and f not almost-everywhere zero there. These hypotheses rule out the degenerate reading Q=0/0 (Lean's division returns 0). Eq. (20) requires R>0 and n<3/2, the range in which the integrals in Eq. (16) converge. Physical constants are arbitrary positive reals; numerical cgs values (e.g. Eqs. (5), (21), (31)) are not formalized. The heuristic parts of the paper (Bohr–Rosenfeld argument, the sum rule (14), astrophysical source estimates, neutrino backgrounds) are out of scope.
Every learning paradigm of the book so far, ERM, SRM, MDL, RLM, is defined by a hypothesis class: the learner searches a predefined set of functions. Nearest Neighbor is the first method that is not. It memorizes the training set and labels a new point by the labels of its closest neighbors, on the assumption that the features are relevant to the labels in a way that makes close-by points likely to share a label. Chapter 19 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), makes that assumption precise, a Lipschitz conditional probability, and proves a finite-sample guarantee: the expected error of the 1-NN rule on m examples is at most twice the Bayes error plus 4cdm−1/(d+1) (Theorem 19.3). The classical results of Cover and Hart (1967) and Stone (1977) are asymptotic; the book insists, as it did in §7.4, on a bound that says what a finite sample buys under an explicit prior assumption. The chapter also proves that the exponential dependence on the dimension is not an artifact (Theorem 19.4, the curse of dimensionality) and, in its exercises, extends the analysis to the k-NN rule, whose error converges to (1+8/k) times the Bayes error (Theorem 19.5).
Setting
The instance domain X carries a metric ρ; for the analysis X=[0,1]d with the Euclidean distance and Y={0,1} with the 0–1 loss. For a sample S=(x1,y1),…,(xm,ym) and a point x, let π1(x),…,πm(x) reorder the sample by distance to x. The k-NN rule returns the majority label among yπ1(x),…,yπk(x); the 1-NN rule is hS(x)=yπ1(x); in general, for φ:(X×Y)k→Y, the k-NN rule with respect to φ is hS(x)=φ((xπ1(x),yπ1(x)),…,(xπk(x),yπk(x))) (19.1).
A distribution D over X×Y has marginal DX and conditional probability η(x)=P[y=1∣x]; the Bayes optimal rule is h⋆(x)=1[η(x)>1/2], and the standing assumption is that η is c-Lipschitz: ∣η(x)−η(x′)∣≤c∥x−x′∥. In the formalization a distribution with conditional probability η is written condLaw DX η: draw x∼DX, then y∼Bernoulli(η(x)). Every distribution with a regression function is of this form, so nothing is lost.
Formalization targets
Goal: Theorem 19.3
For X=[0,1]d, Y={0,1}, a distribution D over X×Y whose conditional probability η is c-Lipschitz, and hS the result of the 1-NN rule on S∼Dm,
ES∼Dm[LD(hS)]≤2LD(h⋆)+4cdm−d+11.
Milestones
Lemma 19.1 (the Lipschitz reduction: ES[LD(hS)]≤2LD(h⋆)+cES,x∥x−xπ1(x)∥); Lemma 19.2 (the expected mass of the sets among C1,…,Cr missed by an i.i.d. sample of size m is at most r/(me)); Theorem 19.4 (for integer c≥2 and every learning rule there is a distribution with c-Lipschitz η and Bayes error 0 on which the rule's expected error is at least 1/4 whenever 2m≤(c+1)d); Lemma 19.7 (the majority of k≥10 independent Bernoulli labels errs, against a label drawn from their mean p, at most (1+8/k) times as often as 1[p>1/2]); Theorem 19.5 (the k-NN bound ES[LD(hS)]≤(1+8/k)LD(h⋆)+(6cd+k)m−1/(d+1)). Lemma 19.6, the k-fold version of Lemma 19.2 with bound 2rk/m, is a further item.
Significance
Theorem 19.3 is the book's answer to the question it raised in §7.4: consistency results say that the 1-NN error converges to twice the Bayes error, but not how fast, and the rate necessarily depends on the distribution. The Lipschitz constant c and the dimension d are exactly the prior knowledge the rule relies on, and Theorem 19.4 shows through the No-Free-Lunch theorem that a sample of size exponential in d is genuinely required for some distributions in the class. Theorem 19.5 quantifies what larger k buys, the factor 2 improving to 1+8/k, at the price of the additive term growing linearly in k. On the platform, this mission introduces the conditional-probability model of a distribution over X×{0,1} and the Bayes rule, which Chapters 24 (generative models) and the nonparametric parts of the book use again, and the box-cover argument of Lemma 19.2, a small combinatorial-probability tool of independent use.
Difficulty
Lemma 19.1 is a computation once the expectation over S and (x,y) is decomposed as the book does: sample the unlabeled points first, find the nearest neighbor, then draw the two labels; the identity P[y=y′]=2η(x)(1−η(x))+(η(x)−η(x′))(2η(x)−1) and LD(h⋆)=Exmin{η,1−η}≥Exη(1−η) finish it. Formally the work is in the decomposition itself, which is Fubini for condLaw and the product law, and in the measurability of the rule, which the statement assumes. Lemma 19.2 is E[1[Ci∩S=∅]]=(1−P[Ci])m≤e−P[Ci]m and maxaae−ma≤1/(me). Theorem 19.3 covers the cube by boxes of side ε, applies Lemma 19.2 to the boxes and sets ε=2m−1/(d+1); a formal proof must handle 1/ε not being an integer (take T=⌈1/ε⌉ boxes per side, so r≤(2/ε)d when ε≤1, which is what the book's 2dε−d already allows for) and the regime m<2d+1, where the trivial bound E∥x−xπ1(x)∥≤d suffices. Theorem 19.4 is the No-Free-Lunch theorem on the grid of spacing 1/c, plus the observation that any {0,1}-valued function on the grid extends to a c-Lipschitz [0,1]-valued function on the cube (McShane). Lemma 19.6 is Chernoff's bound below the mean; Lemma 19.7 is the delicate one: Chernoff with the function h(a)=(1+a)log(1+a)−a and the inequality (1−2p)e−kp+2k(log(2p)+1)≤8/kp for p∈[0,1/2], k≥10, which the book states without proof. Theorem 19.5 assembles Lemmas 19.6 and 19.7 along the four steps of Exercise 4; to reach the book's constants with an integer number of boxes one takes T=⌈m1/(d+1)/2.07⌉ boxes per side and Chernoff at δ=1/3 in Lemma 19.6, or notes that the bound is trivial unless m1/(d+1)>6cd+k.
Formalization scope
Labels are Bool; bernoulliLaw p is the Bernoulli law on Bool, condLaw DX η the distribution with marginal DX and conditional probability η, and bayesRule η the Bayes rule. The cube is the subtype cube d of EuclideanSpace ℝ (Fin d), so its metric is Euclidean and its Borel structure is inherited; the Lipschitz hypothesis is LipschitzWith c η with c : ℝ≥0, together with η x ∈ [0,1] (a conditional probability). A k-NN rule is a learner h with IsKNNRuleWith k φ h: for every sample of size m≥k and every x there is some reordering of the sample by distance to x whose first k entries feed φ; ties are therefore broken arbitrarily, and the theorems hold for every choice. Majority votes predict 1 iff strictly more than half of the k labels are 1, the book's 1[p′>1/2] of Lemma 19.7. The nearest-neighbor distance is nnDist S x = ⨅ i, dist x (S i).1. Expectations over S∼Dm are Bochner integrals against iidLaw D m (Mission I), and the expectation statements assume the rule is measurable in (S,x), the book's Remark 3.1; without it the integrals would be junk. Lemmas 19.2 and 19.6 are stated for arbitrary measurable subsets of an arbitrary measurable space, as in the book, with m≥1 (for m=0 the left side is ∑iP[Ci] while Lean reads r/(0⋅e) as 0). Lemma 19.7 uses the product of Bernoulli laws on Fin k → Bool.
Two statements are given as their proofs support them, and the deviations are recorded in the item texts. Theorem 19.4 takes c≥2 an integer (the grid has spacing 1/c), fixes m with 2m≤(c+1)d before choosing the distribution (Theorem 5.1 produces a distribution per m), and concludes that the expected true error is at least 1/4 (Equation (5.2) in the proof of Theorem 5.1; the book's "greater than 1/4" is what its proof gives for 2m<(c+1)d only in the form of that expectation). Theorem 19.5 keeps the book's constants; the drafter checked that they are reachable with an integer number of boxes. Not stated: the general weighted-average rules of §19.1 beyond (19.1), the efficient implementation of §19.3, Exercise 3 (a one-line inequality, absorbed into the proof of Theorem 19.5).
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 19. doi:10.1017/CBO9781107298019
T. Cover, P. Hart, Nearest neighbor pattern classification, IEEE Transactions on Information Theory 13(1), 1967. doi:10.1109/TIT.1967.1053964
C. J. Stone, Consistent nonparametric regression, Annals of Statistics 5(4), 1977. doi:10.1214/aos/1176343886
L. Devroye, L. Györfi, G. Lugosi, A Probabilistic Theory of Pattern Recognition, Springer, 1996. doi:10.1007/978-1-4612-0711-5
L.-A. Gottlieb, A. Kontorovich, R. Krauthgamer, Efficient classification for metric data, COLT 2010; IEEE Transactions on Information Theory 60(9), 2014. doi:10.1109/TIT.2014.2339840
Understanding Machine Learning XIII: Multiclass Prediction and RankingTextbook
Motivation
Binary classification is the exception in practice; most prediction tasks have many labels, a structured label space, or ask for a ranking. Chapter 17 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) extends linear predictors to these settings through one idea: a class-sensitive feature mappingΨ(x,y) that scores a candidate label, with the prediction hw(x)=argmaxy⟨w,Ψ(x,y)⟩. A cost-sensitive loss Δ(y′,y) replaces the 0–1 loss, and the generalized hinge loss (17.3), maxy′(Δ(y′,y)+⟨w,Ψ(x,y′)−Ψ(x,y)⟩), is its convex surrogate: it upper bounds Δ(hw(x),y), is tight under margin, and is convex and Lipschitz in w. Multiclass SVM is then regularized loss minimization for this loss, and Corollaries 17.1 and 17.2 transfer the guarantees of Chapters 13 and 14 with no dependence on the number of labels. The same construction handles ranking: a linear ranking predictor scores each item, the Kendall tau loss has a pairwise hinge surrogate, and the NDCG surrogate reduces to an assignment problem whose linear relaxation is exact by the Birkhoff–von Neumann theorem (Claim 17.3, Lemma 17.4).
Setting
Labels form a finite nonempty type Y; the feature mapping takes values in Rd as in Mission VI, and the RLM rule and the SGD of Chapters 13 and 14 are those of Missions IX and X. An argmax predictor for (Ψ,w) is any h with h(x) maximizing ⟨w,Ψ(x,y)⟩; a canonical one is fixed by choosing among the maximizers, and likewise a canonical maximizer y^ in the generalized hinge loss, which gives the SGD direction Ψ(x,y^)−Ψ(x,y). The cost Δ is nonnegative with Δ(y,y)=0. For ranking, an example is a list x1,…,xr of instances with a score vector y∈Rr; the linear predictor is (⟨w,xi⟩)i, the Kendall tau loss is the fraction of pairs ordered differently, using the three-valued real sign, and permutations of [r] are Mathlib's permutations of Fin r, with doubly stochastic and permutation matrices from Mathlib.
Formalization targets
Goal: Corollary 17.1
For D over X×Y, ∥Ψ(x,y)∥≤ρ/2, B>0, and the Multiclass SVM learner with λ=2ρ2/(B2m): ES[LDΔ(hw)]≤ES[LDg-hinge(w)], and for every u with ∥u∥≤B, ES[LDg-hinge(w)]≤LDg-hinge(u)+8ρ2B2/m.
Milestones
Equation (17.3). The generalized hinge loss bounds Δ(hw(x),y) for every argmax predictor, equals it under the margin condition, and is convex and ρ-Lipschitz in w with ρ=maxy′∥Ψ(x,y′)−Ψ(x,y)∥.
Corollary 17.2. SGD for multiclass learning with T≥B2ρ2/ϵ2 examples has E[LDΔ(hwˉ)]≤E[LDg-hinge(wˉ)]≤LDg-hinge(u)+ϵ for every ∥u∥≤B.
Equation (17.7). The permutation induced by sorting y maximizes ∑iviyi over permutation vectors (the rearrangement inequality).
Claim 17.3. The doubly stochastic matrices are the convex hull of the permutation matrices.
Lemma 17.4. The assignment LP over doubly stochastic matrices has an optimal solution that is a permutation matrix.
Further items: Remark 17.2 (the binary case recovers the hinge loss) and the Kendall tau surrogate of §17.4.1 with its convexity and Lipschitz constant.
Significance
The generalized hinge loss is the device that lets the whole convex-learning machinery of Part II run on arbitrary finite label sets and on structured outputs, and Remark 17.3's observation that the bounds of Corollaries 17.1 and 17.2 do not depend on ∣Y∣ is what makes structured prediction (§17.3) and ranking with exponentially many labelings feasible. The ranking half of the chapter shows the pattern at work: the induced permutation is an argmax over a combinatorial set (17.7), so the NDCG loss admits a generalized hinge surrogate, and its subgradient is an assignment problem, solvable by the Hungarian method or, thanks to Birkhoff–von Neumann, by linear programming.
Nothing here is machine-checked except that Mathlib contains the Birkhoff–von Neumann theorem, which the corresponding item restates in the book's form. The statements are faithful with the clarifications that ties are broken canonically, that the Kendall tau surrogate is stated for tie-free score vectors (the book's rewriting of the pairwise indicator assumes sign(yi−yj)=0), and that Corollary 17.1 is stated with the measurability conventions of Mission IX.
Difficulty
Remark 17.2 is a two-element maximum and the entry point, and Equation (17.7) is Mathlib's rearrangement inequality for monovarying functions. The properties of the generalized hinge loss are elementary: the bound by choosing y′=hw(x), the equality by showing every term is at most 0 and the term y′=y is 0, convexity as a maximum of affine functions, and the Lipschitz bound by Cauchy–Schwarz on each term. Corollary 17.1 is Mission IX's Corollary 13.9 for the generalized hinge loss, which requires verifying convexity, the ρ-Lipschitz property from ∥Ψ∥≤ρ/2, nonnegativity and boundedness at the origin (by maxΔ, finite), the measurability of the loss and of the canonical argmax predictor as functions of (w,x), and the pointwise comparison with the Δ-loss; Corollary 17.2 is the same with Mission X's Corollary 14.12 and Claim 14.6 for the subgradient. The Kendall tau surrogate is the pairwise hinge bound under no ties, plus the convexity and Lipschitz constant of an average of hinge terms. Lemma 17.4 follows from Birkhoff–von Neumann by the averaging argument of the book, or directly from the finiteness of the permutation matrices together with the fact that a linear function on a convex hull is minimized at an extreme point.
Formalization scope
The label set is finite, so maxima over Y are attained and the losses are well defined; maximizers are chosen canonically, and every statement about argmax predictors holds for any choice. The multivector and TF-IDF constructions of §17.2.1, the reductions of §17.1, structured output prediction (§17.3), the NDCG loss and its surrogate (17.8), and bipartite ranking (§17.5) are not stated; the NDCG construction would need the sorting permutation and the discount function and is left for a later revision. Exercises are not stated except 17.4 through Equation (17.7).
Trivializing readings are excluded: the Δ-risk in Corollaries 17.1 and 17.2 is that of a genuine argmax predictor, the Lipschitz constants are the book's, and the assignment lemma asserts optimality against every doubly stochastic matrix. Welcome contributions: the Lipschitz constant of a maximum of affine functions, the measurability of a canonical argmax over a finite label set, and the extreme-point argument of Lemma 17.4.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 17. doi:10.1017/CBO9781107298019
K. Crammer, Y. Singer, On the algorithmic implementation of multiclass kernel-based vector machines, Journal of Machine Learning Research 2, 2001.
I. Tsochantaridis, T. Joachims, T. Hofmann, Y. Altun, Large margin methods for structured and interdependent output variables, Journal of Machine Learning Research 6, 2005.
G. Birkhoff, Tres observaciones sobre el algebra lineal, Universidad Nacional de Tucumán, Revista A 5, 1946.
H. W. Kuhn, The Hungarian method for the assignment problem, Naval Research Logistics Quarterly 2, 1955. doi:10.1002/nav.3800020109
Understanding Machine Learning XII: Kernel Methods and the Representer TheoremTextbook
Motivation
Chapter 15 bounded the sample complexity of large-margin halfspaces by the norms of the data and of the separator, independently of the dimension. Chapter 16 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) removes the remaining obstacle to using halfspaces in very high-dimensional feature spaces: computation. After embedding the data by a feature map ψ into a Hilbert space, every SVM-like problem has the form minwf(⟨w,ψ(x1)⟩,…,⟨w,ψ(xm)⟩)+R(∥w∥) (16.2), and the representer theorem (Theorem 16.1) says that an optimal solution lies in the span of the mapped examples. Consequently the problem can be rewritten in terms of the m coefficients and the kernelK(x,x′)=⟨ψ(x),ψ(x′)⟩ alone (16.3): this is the kernel trick. The chapter exhibits the polynomial and Gaussian kernels (Examples 16.1 and 16.2), characterizes the functions that are kernels as the positive semidefinite ones (Lemma 16.2), and shows that the SGD solver for Soft-SVM of §15.5 can be run entirely on kernel evaluations (Lemma 16.3).
Setting
A feature map ψ:X→F takes values in a real Hilbert space, a complete real inner product space; its kernel is K(x,x′)=⟨ψ(x),ψ(x′)⟩, and a function K implements an inner product in some Hilbert space if it is the kernel of some feature map into some Hilbert space, quantified existentially in the universe of the domain. The Gram matrix of a sample is Gij=K(xi,xj). The general objective (16.2) is f(⟨w,ψ(x1)⟩,…,⟨w,ψ(xm)⟩)+R(∥w∥) with f arbitrary and R nondecreasing on [0,∞). The SGD procedure of §15.5 in the feature space keeps θ(t) with w(t)=θ(t)/(λ(t+1)) (iterates indexed from 0) and, at each step, for the chosen index i, adds yiψ(xi) to θ when yi⟨w(t),ψ(xi)⟩<1; its kernelized version keeps coefficients β(t) with α(t)=β(t)/(λ(t+1)) and tests yi∑jαj(t)K(xj,xi)<1. Both are driven by the same sequence of chosen indices, which stands for the uniformly random choices of the book.
Formalization targets
Goal: Theorem 16.1 (Representer Theorem)
If R is nondecreasing on [0,∞) and the problem (16.2) has an optimal solution, then there is α∈Rm such that ∑iαiψ(xi) is an optimal solution.
Milestones
Equation (16.3). For w=∑jαjψ(xj) the objective equals f(∑jαjK(xj,x1),…)+R(∑i,jαiαjK(xj,xi)).
Example 16.1. The polynomial kernel (1+⟨x,x′⟩)k on Rn is ⟨ψ(x),ψ(x′)⟩ for the monomial map into R(n+1)k.
Example 16.2. On R, the map ψ(x)n=e−x2/2xn/n! into ℓ2 has ⟨ψ(x),ψ(x′)⟩=e−(x−x′)2/2; the Gaussian kernel e−∥x−x′∥2/(2σ) on Rn is a kernel for every σ>0.
Lemma 16.2. A symmetric K is a kernel iff all its Gram matrices are positive semidefinite.
Lemma 16.3. The kernelized SGD reproduces the feature-space SGD: θ(t)=∑jβj(t)ψ(xj) for all t, hence the outputs coincide.
Further items: Exercise 16.3 (kernel ridge regression: minimizers of the coefficient objective give minimizers of the ridge objective, and (2λmI+G)α=y gives one), Exercise 16.4 (min{x,x′} is a kernel), Exercise 16.6 (the nearest-class-mean rule is a halfspace).
Significance
The representer theorem is the reason kernel methods exist: it reduces an optimization over an arbitrary Hilbert space to one over Rm, and Lemma 16.2 says the reduction needs nothing but a positive semidefinite similarity function, so one may design the kernel directly, as in the string example of §16.2.1. Lemma 16.3 makes the connection to Chapter 14 concrete: a first-order method never leaves the span of the examples, so it too can be run on the Gram matrix. Together with Chapter 15, the chapter closes the book's treatment of linear predictors: expressive through the embedding, statistically controlled through the margin, and computable through the kernel.
Nothing here is machine-checked. The statements are faithful to the book with two clarifications: the representer theorem assumes the existence of an optimal solution, which the book's proof also assumes, and the kernel-SGD equivalence is stated for a fixed sequence of chosen indices, which is the content of the book's inductive proof.
Difficulty
Equation (16.3) and Exercise 16.6 are inner-product algebra and the entry points. The representer theorem needs the orthogonal decomposition w⋆=∑iαiψ(xi)+u with u orthogonal to the span, which is available in Mathlib for the finite-dimensional, hence complete, subspace spanned by the ψ(xi), together with the Pythagorean identity and the monotonicity of R. Example 16.1 is the multinomial expansion of (1+⟨x,x′⟩)k as a sum over index vectors, packaged as an inner product in the Euclidean space indexed by {0,…,n}k. Example 16.2 needs the summability of xn(x′)n/n! and the exponential series, and, for the general Gaussian kernel, either an explicit construction or Lemma 16.2 together with the positive semidefiniteness of the Gaussian Gram matrix. Lemma 16.2 in the nontrivial direction is the construction of the reproducing kernel Hilbert space: the pre-Hilbert space of finite combinations of the functions K(⋅,x), the inner product defined through K, its well-definedness and positive definiteness from the Gram matrices, and the completion, which Mathlib provides for inner product spaces. Lemma 16.3 is an induction on t with the identity ⟨w(t),ψ(xi)⟩=∑jαj(t)K(xj,xi). Exercise 16.3 combines the representer theorem with the identity between the two objectives on the span and the first-order condition for a convex quadratic; Exercise 16.4 needs a feature map such as ψ(x)=(1[1≤j≤x])j, or the positive semidefiniteness of the min matrix.
Formalization scope
Hilbert spaces are real, complete inner product spaces; the existential in IsKernel ranges over Hilbert spaces in the universe of the domain, which the reproducing kernel construction respects. The objective (16.2) has real-valued f, so the hard-SVM instance with f∈{0,∞} is not covered by the representer item as stated. The SGD procedures are deterministic given the index sequence; the random choice of indices is not modelled, exactly as in Lemma 16.3's proof. The string kernel of §16.2.1 and Exercise 16.1, the kernelized Perceptron (Exercise 16.2), Exercise 16.5 and part (2) of Exercise 16.6 are not stated.
Trivializing readings are excluded: the representer theorem asserts optimality against every w, Lemma 16.2 is a biconditional with symmetry assumed as the book does, and the kernels of the examples are exhibited with explicit feature spaces where the book gives them. Welcome contributions: the orthogonal decomposition against a finite span, the multinomial identity of Example 16.1, and the reproducing kernel Hilbert space construction behind Lemma 16.2.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 16. doi:10.1017/CBO9781107298019
B. Schölkopf, R. Herbrich, A. J. Smola, A generalized representer theorem, Proceedings of COLT, 2001. doi:10.1007/3-540-44581-1_27
B. Schölkopf, A. J. Smola, Learning with Kernels, MIT Press, 2002.
M. A. Aizerman, E. M. Braverman, L. I. Rozonoer, Theoretical foundations of the potential function method in pattern recognition learning, Automation and Remote Control 25, 1964.
Understanding Machine Learning XI: Support Vector Machines and MarginTextbook
Motivation
The sample complexity of learning halfspaces in Rd grows with d, which is bad news when features are many or infinite. Chapter 15 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) introduces the support vector machine, the learning rule that replaces dimension by geometry. Among the halfspaces separating a sample, Hard-SVM picks the one of largest margin, the distance from the hyperplane to the nearest example (Claim 15.1, Lemma 15.2); if the data are separable with margin γ and lie in a ball of radius ρ, the resulting classifier has error O(ρ/(γm)) whatever the dimension (Theorem 15.4), and the Perceptron of Chapter 9 makes at most (ρ/γ)2 updates (Remark 15.1). Soft-SVM drops separability by allowing slack variables, and Claim 15.5 identifies it with regularized hinge-loss minimization, so that the stability theory of Chapter 13 applies: the hinge loss is ∥x∥-Lipschitz (Claim 15.6), and Corollary 15.7 gives an expected-risk bound depending only on the norms of the data and of the comparison halfspace. The chapter closes with the optimality conditions that explain the name: the Hard-SVM solution is a combination of the examples on the margin (Theorem 15.8, via the Fritz John conditions, Lemma 15.9).
Setting
Vectors live in Rd as in Mission VI; labels are real numbers, with y∈{±1} as a hypothesis wherever the book needs it. A sample is linearly separable if some halfspace (w,b) has yi(⟨w,xi⟩+b)>0 for all i, and the margin of (w,b) on the sample is miniyi(⟨w,xi⟩+b). Hard-SVM solutions are minimizers of ∥w∥ subject to yi(⟨w,xi⟩+b)≥1, formalized as a relation; the minimizer is unique whenever the constraints are feasible, and the homogenous version sets b=0. A distribution over Rd×{±1} is separable with a (γ,ρ)-margin if some unit w⋆ (and b⋆) has y(⟨w⋆,x⟩+b⋆)≥γ and ∥x∥≤ρ almost surely. Soft-SVM is the problem λ∥w∥2+m1∑ξi under yi(⟨w,xi⟩+b)≥1−ξi, ξi≥0; its homogenous form is the regularized loss minimization rule of Mission IX for the hinge loss max{0,1−y⟨w,x⟩}, and the 0–1 loss is 1[y⟨w,x⟩≤0]. Expectations over samples are integrals against Dm, with the measurability conventions of Mission IX.
Formalization targets
Goal: Corollary 15.7, last part
For D on {∥x∥≤ρ}×{±1} almost surely, B>0, and the Soft-SVM learner with λ=2ρ2/(B2m): ES[LD0−1(A(S))]≤ES[LDhinge(A(S))], and for every w with ∥w∥≤B, ES[LDhinge(A(S))]≤LDhinge(w)+8ρ2B2/m.
Milestones
Claim 15.1. The distance from x to {v:⟨w,v⟩+b=0} with ∥w∥=1 is ∣⟨w,x⟩+b∣.
Lemma 15.2. For a sample with both labels present, the normalized Hard-SVM output has unit norm and margin at least that of every unit-norm halfspace.
Theorem 15.4. Under homogenous (γ,ρ)-separability, with probability at least 1−δ the 0–1 risk of the Hard-SVM output is at most 4(ρ/γ)2/m+2log(2/δ)/m.
Claim 15.5. Every feasible slack vector has average at least the hinge loss, and the hinge losses are feasible slacks.
Claim 15.6. For y∈{±1}, w↦max{0,1−y⟨w,x⟩} is ∥x∥-Lipschitz.
Corollary 15.7, first parts. For every u, ES[LDhinge(A(S))] and ES[LD0−1(A(S))] are at most LDhinge(u)+λ∥u∥2+2ρ2/(λm).
Theorem 15.8. The homogenous Hard-SVM solution is ∑i∈Iαixi with I={i:∣⟨w0,xi⟩∣=1}.
Lemma 15.9. Fritz John conditions, in the correct form with a multiplier on ∇f.
Further items: Exercise 15.1 (the two Hard-SVM formulations agree) and Exercise 15.2 (the Perceptron makes at most (ρ/γ)2 updates).
Significance
SVM is the bridge between the statistical theory of Part I and the kernel methods of Chapter 16: because the bounds of Theorem 15.4 and Corollary 15.7 involve only ρ, γ and B, the same algorithm can be run after an embedding into a huge or infinite-dimensional feature space, and Theorem 15.8, that the solution lies in the span of the examples, is what makes the embedding computable. Corollary 15.7 is also the first place where the abstract machinery of Chapter 13 is applied to a specific learning rule.
Nothing here is machine-checked. One correction is built in: the Fritz John lemma is stated with the multiplier α0≥0 on ∇f(w⋆) and nonnegative multipliers not all zero, since the printed form, with ∇f(w⋆) unweighted and α unrestricted, fails already for f(w)=w and g1(w)=w2 on the line. Theorem 15.8 is unaffected: its constraints are affine, so the multiplier on ∇f can be taken to be 1.
Difficulty
Claim 15.6 and Claim 15.5 are short inequalities and the intended entry points, and Exercise 15.2 is Theorem 9.1 of Mission VI with B≤1/γ and R≤ρ. Claim 15.1 is the book's computation with the foot of the perpendicular v=x−(⟨w,x⟩+b)w and a Pythagorean inequality for every other point of the hyperplane, packaged as an infimum distance. Lemma 15.2 is the rescaling argument of the book, together with the observation that both labels force w0=0; Exercise 15.1 needs the positivity of the optimal margin on a separable sample. Corollary 15.7 is Corollaries 13.8 and 13.9 of Mission IX for the hinge loss, whose Lipschitz constant is ∥x∥ only on the support of D, so the stability argument must be run with the almost-sure bound; the 0–1 clause is the pointwise inequality ℓ0−1≤ℓhinge. Theorem 15.4 is the content of §26.3: Rademacher complexity of the class of norm-bounded halfspaces, the contraction lemma for the ramp loss, the observation that the Hard-SVM output has zero ramp loss on the sample and norm at most 1/γ, and a concentration step, all of which will be items of the Rademacher mission. Theorem 15.8 is the KKT theorem for a strictly convex quadratic with affine constraints (Slater's condition holds), and Lemma 15.9 is the general Fritz John theorem for differentiable data, whose proof goes through a separation or penalty argument; neither is in Mathlib.
Formalization scope
Hard-SVM and Soft-SVM are relations and learners, not programs; the margin is a real infimum over the sample; the ramp loss is defined but its bounds belong to Chapter 26. Theorem 15.4 is stated for any learner that returns the Hard-SVM solution whenever the sample is feasible, which is almost surely the case under the margin assumption, and bounds the failure event in outer measure. Corollary 15.7 carries the measurability conventions of Mission IX. The Fritz John lemma is stated correctly rather than as printed. The duality of §15.4, the SGD implementation of §15.5 (whose guarantee needs the trajectory bound of §14.5.3 rather than Theorem 14.11 as stated in Mission X), Exercises 15.3 and 15.4, and Remark 15.2 are not stated.
Trivializing readings are excluded: both labels must be present for the normalized Hard-SVM output, the margin assumption and the support condition are almost sure with respect to D, and the risks are genuine integrals. Welcome contributions: the uniqueness of the Hard-SVM minimizer, the KKT conditions for affine constraints, and the pointwise comparison of the 0–1, ramp and hinge losses.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 15. doi:10.1017/CBO9781107298019
C. Cortes, V. Vapnik, Support-vector networks, Machine Learning 20(3), 1995. doi:10.1007/BF00994018
B. E. Boser, I. M. Guyon, V. N. Vapnik, A training algorithm for optimal margin classifiers, Proceedings of COLT, 1992. doi:10.1145/130385.130401
F. John, Extremum problems with inequalities as subsidiary conditions, in Studies and Essays Presented to R. Courant, 1948.
N. Cristianini, J. Shawe-Taylor, An Introduction to Support Vector Machines, Cambridge University Press, 2000. doi:10.1017/CBO9780511801389
The Principles of Deep Learning Theory II: Deep Linear Networks at InitializationTextbook
Motivation
Chapter 3 of The Principles of Deep Learning Theory by D. A. Roberts and S. Yaida (arXiv:2106.10165) is the book's first complete example of its effective-theory method. For deep linear networks at initialization, the two- and four-point correlators of the network outputs can be computed exactly at any width and depth. The resulting formulas exhibit, in the simplest setting, the phenomena that organize the rest of the book: criticality of the weight variance CW=1, non-Gaussianity that grows with depth, and the depth-to-width ratio ℓ/n as the parameter controlling deviations from the infinite-width limit. This mission formalizes §§3.1–3.3. It is the second mission in a series formalizing the book (namespace DeepLearningTheory).
Setting
A deep linear network with widths n0,n1,n2,… (all positive) and zero biases maps an input x∈Rn0 to preactivations
(eqs. 3.1–3.2 with b(ℓ)=0). At initialization all weights Wij(ℓ) are independent centered Gaussians with E[Wi1j1(ℓ)Wi2j2(ℓ)]=δi1i2δj1j2CW/nℓ−1 (eq. 3.4), with a layer-independent CW≥0. For inputs xα1,xα2 let Gα1α2(0)=n01∑jxj;α1xj;α2 (eq. 3.9).
Formalization targets
Goal: the exact four-point correlator (eqs. 3.21, 3.25)
For every layer ℓ≥1, a single input x, and neurons i1,…,i4,
Eqs. (3.12), (3.15) — two-point correlator in layer ℓ: δi1i2CWℓGα1α2(0).
Eq. (3.18) — first-layer four-point correlator.
Eq. (3.20) — the layer-to-layer recursion for the four-point correlator.
Eqs. (3.21)–(3.24) — the recursion G4(ℓ+1)=CW2(1+2/nℓ)G4(ℓ) for the coefficient of the Wick tensor structure.
Eq. (3.30) — the connected four-point correlator between two distinct neurons, G4(ℓ)−(G2(ℓ))2.
Significance
The closed forms show that a deep linear network is exactly Gaussian only in the strict infinite-width limit: at criticality CW=1 the connected four-point correlator (3.29)–(3.30) is [∏(1+2/nℓ′)−1](G(0))2≈n2(ℓ−1)(G(0))2 for equal widths n, the first appearance of the depth-to-width ratio as the book's emergent scale. The same recursive method is reused for nonlinear networks in Chapters 4–5. The results are exact computations in the book; this mission formalizes them.
Difficulty
Each correlator is an expectation of a polynomial in exponentially many Gaussian weights. The book's recursion uses that the layer-(ℓ+1) weights are independent of the layer-ℓ preactivations, followed by Wick contraction of the two or four new weights. In Lean this requires independence of a weight family from a measurable function of the earlier layers, integrability of products of Gaussian polynomials, and careful handling of the Kronecker-delta bookkeeping in the sums (3.23).
Formalization scope
Widths are n : ℕ → ℕ with n 0 the input dimension; neural indices are 0,…,nℓ−1. Weights are a random field W : Ω → ℕ → ℕ → ℕ → ℝ on a probability space, only entries Wij(ℓ) with ℓ≥1, i<nℓ, j<nℓ−1 are used.
IsLinearNetInit P n CW W states mutual independence of all these weights and that each has law gaussianReal 0 (CW / n (ℓ-1)).
linearPreact n (W ω) x ℓ i is zi(ℓ)(x); inputKernel (n 0) x₁ x₂ is Gα1α2(0); kron and wickDelta4 are the Kronecker delta and the three-term tensor structure.
Widths are assumed positive where the source's formulas require it (division by nℓ, nonempty hidden layers). Every hypothesis is satisfiable by a product of independent Gaussians.
Selected references
D. A. Roberts, S. Yaida (with B. Hanin), The Principles of Deep Learning Theory, Cambridge University Press, 2022, Chapter 3. arXiv:2106.10165
B. Hanin, M. Nica, Products of many large random matrices and gradients in deep neural networks, Commun. Math. Phys. 376 (2020). arXiv:1812.05994
The Principles of Deep Learning Theory III: Preactivation Statistics in the First Two LayersTextbook
Motivation
Chapter 4 of The Principles of Deep Learning Theory by D. A. Roberts and S. Yaida (arXiv:2106.10165) begins the analysis of general multilayer perceptrons (MLPs) with a nonlinear activation function σ at initialization. The first layer is exactly Gaussian; the second layer is the first place where non-Gaussianity appears, as a connected four-point correlator suppressed by 1/n1 and governed by the four-point vertexV(2). This mission formalizes §§4.1–4.2, which are exact at any width. It is the third mission in a series formalizing the book (namespace DeepLearningTheory) and reuses the definitions of Mission II (Deep Linear Networks at Initialization).
Setting
An MLP with widths n0,n1,n2,… and activation σ:R→R maps inputs xα∈Rn0 to preactivations
(eqs. 4.2, 4.30). At initialization all biases and weights are independent centered Gaussians with E[bi(ℓ)bj(ℓ)]=δijCb(ℓ) and E[Wi1j1(ℓ)Wi2j2(ℓ)]=δi1i2δj1j2CW(ℓ)/nℓ−1 (eqs. 4.3–4.4). The first-layer metric is Gα1α2(1)=Cb(1)+CW(1)n01∑jxj;α1xj;α2 (eq. 4.8), and ⟨F(zα1,…,zαm)⟩g denotes the expectation over a centered Gaussian vector (zα) with covariance g (eq. 4.25), with σα≡σ(zα).
Eq. (4.9) — first-layer four-point correlator is the Wick value.
Eq. (4.23) — the first-layer preactivations are exactly Gaussian with covariance δi1i2Gα1α2(1).
Eqs. (4.27), (4.28), (4.29) — activation correlators in the first layer as Gaussian expectations.
Eq. (4.40) — two-point correlator of the second-layer metric fluctuation.
Eq. (4.41) — second-layer two-point correlator.
Significance
These identities are the base case of the book's recursion (Chapter 4.3 onward) for the kernel and four-point vertex in deeper layers, and they show concretely that a finite-width network is not a Gaussian process: the 1/n1 connected correlator is generically nonzero for nonlinear σ. The results are exact computations in the book; this mission formalizes them.
Difficulty
The second layer is a Gaussian conditional on the first layer, with a random covariance (the stochastic metric, eq. 4.36). Turning this into unconditional correlators requires conditioning on the first-layer preactivations, independence of different first-layer neurons, and the identification of first-layer activation correlators with Gaussian expectations over the metric G(1), which may be degenerate (e.g. repeated inputs). Integrability of σ against Gaussians must be controlled.
Formalization scope
Definitions from Mission II are reused: kron, inputKernel, WeightIndex. New definitions: mlpPreact (zi(ℓ)(x)), IsMLPInit (independent Gaussian biases and weights with layer-dependent Cb(ℓ),CW(ℓ)), firstLayerMetric (G(1) on finitely many inputs), gaussAvg (⟨⋅⟩g, via Mathlib's multivariateGaussian, which handles singular positive-semidefinite g), and HasPolyGrowth.
Statements about activations assume σ measurable with polynomial growth, the standing convention guaranteeing that all Gaussian averages are finite; this covers ReLU, tanh, sigmoid, GELU, SWISH and the perceptron step function.
The sample set is Fin D (for the specific statements, D=2 or 4 inputs, possibly repeated). n1>0 is assumed where the formulas divide by n1.
Selected references
D. A. Roberts, S. Yaida (with B. Hanin), The Principles of Deep Learning Theory, Cambridge University Press, 2022, Chapter 4. arXiv:2106.10165
Chapter 13 showed that convex-Lipschitz-bounded and convex-smooth-bounded problems are learnable by regularized loss minimization; Chapter 14 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) shows how to learn them with the simplest possible algorithm. Gradient descent moves against the gradient with a fixed step size and outputs the average of its iterates; its analysis (Lemma 14.1) is a single telescoping identity that bounds ∑t⟨w(t)−w⋆,vt⟩ for any sequence of directions vt, and this generality is the whole point. It gives the rate Bρ/T for convex Lipschitz functions (Corollary 14.2), extends to nondifferentiable functions through subgradients (Definition 14.4, Lemmas 14.3 and 14.7), and, because it never used that the directions were gradients, extends to stochastic gradient descent, in which each direction is random with a subgradient as its conditional expectation (Theorem 14.8). Applied to the risk LD(w) with a fresh example at each step, SGD is a learning algorithm whose sample complexity is the iteration count: B2ρ2/ϵ2 examples for convex-Lipschitz-bounded problems (Corollary 14.12) and 12B2β/ϵ2 for convex-smooth-bounded ones (Theorem 14.13, Corollary 14.14). A projected, decreasing-step variant for strongly convex objectives has rate (ρ2/(2λT))(1+logT) (Theorem 14.11).
Setting
Hypotheses are vectors in Rd; convex, Lipschitz and smooth losses, convex-Lipschitz-bounded and convex-smooth-bounded problems, and strong convexity are those of Mission IX. A vector v is a subgradient of f at w if f(u)≥f(w)+⟨u−w,v⟩ for all u. The iterates of an update rule w(1)=0, w(t+1)=w(t)−ηvt are indexed from 0, and the output after T steps is wˉ=T1∑t<Tw(t). The randomness of SGD is modelled as the chapter uses it in §14.5: a sample z0,…,zT−1 drawn i.i.d. from D and an oracle g with vt=g(w(t),zt), where g is a stochastic subgradient oracle for f if Ez∼Dg(w,z)∈∂f(w) for every w. This is the book's condition E[vt∣w(t)]∈∂f(w(t)) in the case where the direction depends on the past only through w(t) and on fresh randomness, which is what every application in the book does; the expectation E[f(wˉ)] is then an integral over DT. For learning, g(w,z) is a subgradient of ℓ(⋅,z) at w, so that Ezg(w,z) is a subgradient of LD at w (14.13). The projection of w onto a convex set H is a nearest point of H, and the strongly convex variant projects after each step with step size 1/(λt).
Formalization targets
Goal: Theorem 14.8
For a convex f, B,ρ>0, a measurable oracle g with Ezg(w,z)∈∂f(w) and ∥g(w,z)∥≤ρ, any w⋆ with ∥w⋆∥≤B, T≥1 and η=B/(ρT): E[f(wˉ)]−f(w⋆)≤Bρ/T; and for every ϵ>0, T≥B2ρ2/ϵ2 gives E[f(wˉ)]−f(w⋆)≤ϵ.
Milestones
Lemma 14.1. For any directions, ∑t<T⟨w(t)−w⋆,vt⟩≤∥w⋆∥2/(2η)+(η/2)∑t<T∥vt∥2; with ∥vt∥≤ρ, ∥w⋆∥≤B and η=B/(ρT) the average is at most Bρ/T.
Corollary 14.2. Subgradient descent on a convex ρ-Lipschitz f with η=B/(ρT) has f(wˉ)−f(w⋆)≤Bρ/T for every ∥w⋆∥≤B, and T≥B2ρ2/ϵ2 gives ϵ.
Lemma 14.7. A convex f on Rd is ρ-Lipschitz iff all its subgradients have norm at most ρ.
Lemma 14.9. For the projection v of w onto a convex H and u∈H, ∥w−u∥2≥∥v−u∥2.
Theorem 14.11. For λ-strongly convex f, a closed convex H, an oracle with Ez∥g(w,z)∥2≤ρ2 and any w⋆∈H, the projected variant with ηt=1/(λt) has E[f(wˉ)]−f(w⋆)≤(ρ2/(2λT))(1+logT).
Corollary 14.12. SGD on the risk of a convex-Lipschitz-bounded problem with T≥B2ρ2/ϵ2 examples has E[LD(wˉ)]≤LD(w)+ϵ for every w∈H.
Theorem 14.13. For convex, β-smooth, nonnegative losses and ηβ<1, SGD with gradient directions has E[LD(wˉ)]≤1−ηβ1(LD(w⋆)+∥w⋆∥2/(2ηT)).
Corollary 14.14. For a convex-smooth-bounded problem with ℓ(0,z)≤1 and any ϵ>0, SGD with η=1/(β(1+3/ϵ)) and T≥12B2β/ϵ2 has E[LD(wˉ)]≤LD(w)+ϵ for every w∈H.
Further items: Lemma 14.3, Claims 14.5, 14.6 and 14.10, and the hinge-loss subgradient of Example 14.2.
Significance
SGD is the algorithm behind most of modern machine learning, and Theorem 14.8 is its basic guarantee: dimension-free, independent of the form of f beyond convexity, and with a sample complexity matching the regularization bound of Chapter 13 up to a constant. Lemma 14.1 isolates the deterministic identity that makes both gradient descent and its stochastic version work, and Lemma 14.7 is the bridge between the Lipschitz assumption of Chapter 12 and the bounded directions the analysis needs. The learning corollaries make the point that runs through Part II of the book: for convex problems, optimization and learning are the same activity, and one pass over the data suffices.
Nothing here is machine-checked. The chapter's statements are essentially correct, and the formalization records the reading choices rather than corrections: the i.i.d.-oracle model of the randomness, the subgradient form of gradient descent, the bound at every point of the ball rather than at a minimizer, and, in Corollary 14.14, the assumptions ϵ≤1 and 0∈H under which the derivation from Theorem 14.13 goes through.
Difficulty
Lemma 14.1 is a completed square and a telescoping sum and is the intended entry point; the Bρ/T clause is the substitution of η. Corollary 14.2 is Lemma 14.1 with Jensen's inequality for the average and the subgradient inequality at each iterate, plus Lemma 14.7 to bound the directions. The subgradient facts need convex analysis: Lemma 14.3 in the direction "convex implies subgradients exist" is the supporting hyperplane theorem on Rd, which Mathlib does not offer directly; Claim 14.5 uses the first-order characterization of convexity for differentiable functions; Lemma 14.7's "Lipschitz implies bounded subgradients" is the book's one-line argument along u=w+ϵv/∥v∥. Theorem 14.8 is Lemma 14.1 plus the conditioning argument of the book, which in the i.i.d.-oracle model is Fubini on the product DT: the iterate w(t) is a measurable function of z0,…,zt−1, and integrating ⟨w(t)−w⋆,g(w(t),zt)⟩ over zt first gives ⟨w(t)−w⋆,Ezg(w(t),z)⟩≥f(w(t))−f(w⋆). Theorem 14.11 adds the projection lemma, the strong-convexity inequality of Claim 14.10, the telescoping of 2λt(at−at+1)−2λat and the harmonic sum ∑t≤T1/t≤1+logT; the second-moment hypothesis makes E∥w(t)−w⋆∥2 finite inductively. Corollary 14.12 is Theorem 14.8 for f=LD with the oracle of (14.13), which requires exchanging a subgradient inequality with the integral over z. Theorem 14.13 replaces the Lipschitz bound by self-boundedness, ∥∇ℓ∥2≤2βℓ, and rearranges; Corollary 14.14 is its arithmetic under the added assumptions. In all expectation statements the measurability of the iterates in the sample, from the measurability of the oracle, is a routine but necessary lemma.
Formalization scope
Iterates are defined by structural recursion, so no argmin is chosen; the sample-driven SGD stops after T updates; the projection onto H is a chosen nearest point, unique for closed convex H. Bounds are stated for every w⋆ in the ball (or in H) rather than for a minimizer, which is what the proofs give and is stronger. The oracle bound ∥g(w,z)∥≤ρ is required surely (the book: with probability 1); the almost-sure version is a routine extension. The second-moment hypothesis of Theorem 14.11 is a lower Lebesgue integral, so that a non-integrable oracle cannot satisfy it vacuously. The learning corollaries assume a measurable loss, nonnegative and bounded at the origin, so that the risks are genuine integrals, and a measurable selector of subgradients. Variable step sizes (§14.4.2), other averaging schemes (§14.4.3), SGD for regularized loss minimization (§14.5.3) and the exercises are not stated.
Trivializing readings are excluded: the expectations are over the product law of the examples with measurable integrands, the subgradient conditions are pointwise inequalities, and the iteration counts are the book's. Welcome contributions: Lemma 14.1 as a reusable telescoping lemma, the measurability of the SGD iterates, and the Fubini step that turns an oracle condition into the inequality (14.10).
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 14. doi:10.1017/CBO9781107298019
H. Robbins, S. Monro, A stochastic approximation method, Annals of Mathematical Statistics 22(3), 1951. doi:10.1214/aoms/1177729586
M. Zinkevich, Online convex programming and generalized infinitesimal gradient ascent, Proceedings of ICML, 2003.
A. Nemirovski, A. Juditsky, G. Lan, A. Shapiro, Robust stochastic approximation approach to stochastic programming, SIAM Journal on Optimization 19(4), 2009. doi:10.1137/070704277
S. Shalev-Shwartz, Online learning and online convex optimization, Foundations and Trends in Machine Learning 4(2), 2012. doi:10.1561/2200000018
Understanding Machine Learning IX: Convex Learning Problems, Regularization and StabilityTextbook
Motivation
Chapters 12 and 13 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) leave binary classification for the general framework in which a hypothesis is a vector w∈Rd and the loss ℓ(w,z) is a convex function of w. Convexity makes the ERM problem tractable (Lemma 12.11), but Examples 12.8 and 12.9 show that convexity, even with a bounded class, does not by itself make a problem learnable: one-dimensional linear regression with the squared loss defeats every learner. The chapter therefore isolates two families, the convex-Lipschitz-bounded and the convex-smooth-bounded problems (Definitions 12.12 and 12.13), and Chapter 13 proves that both are learnable, not by ERM but by Regularized Loss Minimization with Tikhonov regularization, A(S)∈argminwLS(w)+λ∥w∥2. The proof goes through a new idea: stability. Theorem 13.2 expresses the expected overfitting E[LD(A(S))−LS(A(S))] exactly as the expected effect of replacing one training example, strong convexity of the regularized objective bounds that effect (Lemma 13.5, Corollaries 13.6 and 13.7), and balancing the regularization against the fit gives oracle inequalities (Corollaries 13.8 and 13.10) and sample-complexity guarantees (Corollaries 13.9 and 13.11), with ridge regression as the worked example (Theorem 13.1).
Setting
Hypotheses are vectors in Rd with the Euclidean norm, as in Mission VI; risk, empirical risk, the product law of a sample and agnostic PAC learnability are those of Mission I. A problem is convex when H is convex and every ℓ(⋅,z) is convex; it is convex-Lipschitz-bounded with parameters ρ,B when moreover ∥w∥≤B on H and every ℓ(⋅,z) is ρ-Lipschitz on Rd, and convex-smooth-bounded with parameters β,B when every ℓ(⋅,z) is nonnegative and differentiable with a β-Lipschitz gradient. Lipschitzness and smoothness are required on all of Rd because the RLM rule is unconstrained and its outputs need not lie in H. The RLM rule is a relation: w is an output on S if it minimizes LS(w)+λ∥w∥2 over Rd, and a learner implements the rule if all its outputs are minimizers. For the losses of the chapter the minimizer exists and is unique. Given S=(z1,…,zm) and a further example z′, S(i) is S with zi replaced by z′; a learner is on-average-replace-one-stable with rate ϵ(m) if E(S,z′)∼Dm+1,i∼U(m)[ℓ(A(S(i)),zi)−ℓ(A(S),zi)]≤ϵ(m) for every distribution. Strong convexity is Mathlib's StrongConvexOn, which is Definition 13.4 verbatim.
Expectations over samples are integrals against product laws. For them to be genuine, the theorems about arbitrary learners assume a jointly measurable loss bounded by a constant and a measurable learner, and the theorems about RLM assume a jointly measurable, nonnegative loss bounded at the origin and a measurable learner; for RLM the latter is automatic, since the minimizer is unique.
Formalization targets
Goal: Corollary 13.9
For a convex-Lipschitz-bounded problem with parameters ρ,B>0 and the RLM learner with λ(m)=2ρ2/(B2m): for every distribution, every m≥1 and every w∈H, ES[LD(A(S))]≤LD(w)+ρB8/m; hence for every ϵ>0 and m≥8ρ2B2/ϵ2, ES[LD(A(S))]≤LD(w)+ϵ.
Milestones
Examples 12.8–12.9. Linear regression on R with the squared loss is not agnostic PAC learnable, over H=R or over H=[−1,1].
Theorem 13.2. For any measurable learner and m≥1, ES[LD(A(S))−LS(A(S))] equals the replace-one expectation of (13.6).
Lemma 13.5.λ∥w∥2 is 2λ-strongly convex; a strongly convex function plus a convex one is strongly convex; at a minimizer u of a λ-strongly convex f, f(w)−f(u)≥2λ∥w−u∥2.
Corollary 13.6. For a convex ρ-Lipschitz loss and λ>0, RLM satisfies ℓ(A(S(i)),zi)−ℓ(A(S),zi)≤2ρ2/(λm) for every S,z′,i, is stable with that rate, and has ES[LD(A(S))−LS(A(S))]≤2ρ2/(λm).
Corollary 13.7. For a convex, nonnegative, β-smooth loss and λ≥2β/m, the replace-one expectation is at most (48β/(λm))E[LS(A(S))], and at most 48βC/(λm) if ℓ(0,z)≤C.
Corollary 13.8.ES[LD(A(S))]≤LD(w∗)+λ∥w∗∥2+2ρ2/(λm) for every w∗.
Corollary 13.11. A convex-smooth-bounded problem with ℓ(0,z)≤1 is learned by RLM with λ=ϵ/(3B2) once m≥150βB2/ϵ2.
Theorem 13.1. Ridge regression on the unit ball with labels in [−1,1], λ=ϵ/(3B2) and m≥150B2/ϵ2 has ES[LD(A(S))]≤min∥w∥≤BLD(w)+ϵ.
Further items: Lemma 12.11, the hinge loss as a convex surrogate of the 0–1 loss, the stability-implies-no-overfitting remark of §13.2, and the ridge regression system (13.4)–(13.5).
Significance
Stability is the third route to learnability in the book after uniform convergence and nonuniform learnability, and the only one that applies to convex-Lipschitz-bounded problems in general, for which uniform convergence can fail (the book's Exercise 13.2). The chain from strong convexity through replace-one stability to oracle inequalities is the template for the analysis of every regularized learner, and Theorem 13.2 is an exact identity, not a bound. Ridge regression, support vector machines (Chapter 15) and the regularized algorithms of later chapters are all instances.
Nothing here is machine-checked. The sample sizes of Corollary 13.11 and Theorem 13.1 are the book's 150. Chaining Corollary 13.10 as printed would need 216, but the derivation of Corollary 13.7 actually gives the stability rate 20β/(λm), with which 90 suffices.
Difficulty
Lemma 12.11 and the hinge surrogate are direct. Lemma 13.5 is elementary but part (3) needs the limit α→0 of the strong-convexity inequality at a minimizer. Examples 12.8–12.9 require constructing the two finitely supported distributions of the book and computing the risk of a fixed output on each; the probability that all m examples are of the second type is at least 0.99 under both, and the deterministic learner's output on that sample decides which distribution defeats it. Theorem 13.2 is the exchangeability argument of the book: E[ℓ(A(S),z′)]=E[ℓ(A(S(i)),zi)] because swapping zi and z′ preserves the product law; the formal work is the measure-preserving transposition on Zm+1 and the integrability of the functions involved. Corollaries 13.6 and 13.7 follow the book's pointwise derivation from (13.7) to (13.11) and (13.12) to (13.14), where the smooth case uses the self-boundedness ∥∇ℓ∥2≤2βℓ of nonnegative smooth functions and the inequality (a+b)2≤3(a2+b2); passing to expectations then uses Theorem 13.2 and, for the smooth case, the symmetry E[ℓ(A(S(i)),z′)]=E[ℓ(A(S),zi)]. Corollaries 13.8 to 13.11 are the arithmetic of the book once (13.16), E[LS(A(S))]≤LD(w∗)+λ∥w∗∥2, is in hand, with the corrected constant for 13.11. The ridge system is the gradient condition for a strongly convex quadratic, and Theorem 13.1 is Corollary 13.11 applied to 21(⟨w,x⟩−y)2, which is ∥x∥2-smooth with ℓ(0,z)=y2/2≤1/2 on the support. In every expectation statement the measurability of S↦A(S) for the RLM rule, which the theorems take as a hypothesis, is provable from uniqueness of the minimizer and is worth a lemma.
Formalization scope
Losses are real-valued functions of a vector and an example; Lipschitz and smoothness conditions are global on Rd. The RLM rule is a minimizer relation with the regularization parameter as an explicit argument, and Corollary 13.9's learner uses a parameter depending on m. Stability quantifies over m≥1 and averages over the replaced index. Expectation statements carry measurability hypotheses that make every integral genuine, and the theorems about arbitrary learners assume a bounded loss. The minimum over H is stated as "for every w∈H", so no minimizer is needed. Definitions 12.1–12.9 and Claims 12.4–12.9 (general convex analysis) are not restated, nor are Examples 12.10–12.11, the discussion of §12.3 beyond the surrogate property, Remark 13.1, and Exercises 12.1–12.4 and 13.1–13.2.
Trivializing readings are excluded: the nonlearnability examples are stated as negations of the framework's learnability, the stability identity is an equality with both sides genuine integrals, and the constants of the oracle inequalities are the book's. Welcome contributions: the transposition invariance of product laws behind Theorem 13.2, the bound ∥A(S)∥2≤LS(0)/λ for RLM outputs, the measurability of the RLM minimizer, and the self-boundedness inequality (12.6).
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapters 12 and 13. doi:10.1017/CBO9781107298019
O. Bousquet, A. Elisseeff, Stability and generalization, Journal of Machine Learning Research 2, 2002.
S. Shalev-Shwartz, O. Shamir, N. Srebro, K. Sridharan, Learnability, stability and uniform convergence, Journal of Machine Learning Research 11, 2010.
A. N. Tikhonov, On the stability of inverse problems, Doklady Akademii Nauk SSSR 39(5), 1943.
The passivity-admissible couplings have dimension n² = dim u(n)Textbook
Motivation
The Shape Zero model (Shape Zero LLC, unpublished) aims to obtain all three factors of the Standard Model gauge structure — U(1), SU(2) and SU(3) — from a single linear-algebra statement applied at three node sizes. A node carrying n oscillator pairs has a 2n-dimensional real state space with a complex structureJ. Within the model, the couplings that do no net work (passive couplings) are the symmetric matrices, and those that respect J are the ones commuting with it. The claim is that the couplings satisfying both conditions form a real vector space of dimension exactly n2, which is the dimension of the unitary Lie algebra u(n) (Unitary group):
node size n
admissible dimension
Lie algebra
1
1
u(1)
2
4
u(2)=u(1)⊕su(2)
3
9
u(3)=u(1)⊕su(3)
The dimension count has so far been checked numerically for n=1,…,5 only, giving 1,4,9,16,25. A machine-checked proof covers every n, and it is the claim a physicist examining the model would check first.
What this mission does NOT prove. This mission proves the linear algebra: symmetric matrices commuting with J form a space of dimension n2. It does not prove the physics step that passivity forces a coupling to be symmetric. That step is a separate premise of the model, and a completed mission must not be read as establishing it.
Setting
Fix a natural number n. Consider real 2n×2n matrices, with rows and columns indexed by two copies of {0,…,n−1}, so that each matrix is written in 2×2 block form with n×n blocks:
W=(ACBD).
Let I be the n×n identity matrix and define the standard complex structure
J=(0I−I0),
which satisfies J2=−1. In the Lean development this matrix is PassivityUn.stdJ n, and the index type is PassivityUn.Blk n, the disjoint union of two copies of Fin n.
Two real linear subspaces of the 4n2-dimensional space of such matrices are defined:
symm n: the symmetric matrices, WT=W;
commJ n: the matrices commuting with J, WJ=JW.
The admissible coupling classadmissible n is their intersection:
An={W∈R2n×2n:WT=WandWJ=JW}.
Formalization targets
Goal: the admissible class has dimension n2
dimRAn=n2for every n∈N.
This is PassivityUn.admissible_finrank. It asserts the exact dimension for all n at once, not for a particular node size.
Milestones
M1.J⋅J=−1, so J is a complex structure.
M2. A block matrix (ACBD) commutes with J exactly when D=A and B=−C.
M3. A block matrix (AB−BA) is symmetric exactly when AT=A and BT=−B.
M4. The dimension counts of symmetric and antisymmetric n×n matrices add to n2: 2n(n+1)+2n(n−1)=n2.
Significance
The result itself. The goal identifies the admissible coupling class with the real form of the n×n Hermitian matrices, the space whose dimension is that of u(n) (Hermitian matrix). Applied at n=1,2,3 it gives the dimensions 1, 4 and 9, which the Shape Zero model matches with u(1), u(2)=u(1)⊕su(2) and u(3)=u(1)⊕su(3). Without a proof for general n, the model rests on a finite numerical check.
Formalizing it. The underlying fact is standard linear algebra, a special case of the correspondence between real matrices commuting with a complex structure and complex-linear maps (Linear complex structure). No machine-checked statement of this exact dimension count was found in the platform library. The mission produces a verified, general-n statement whose hypotheses are fully explicit, and it separates the verified linear algebra from the unverified physical premise.
Difficulty
Every step is standard linear algebra, so the difficulty is in the formal bookkeeping rather than the mathematics. The dimension of a subspace defined by equations is not computed by any Mathlib tactic. It has to be obtained by exhibiting an explicit linear equivalence with spaces of known dimension, and that requires moving between the 2n×2n matrix indexed by a disjoint union and its four n×n blocks. Checking small cases numerically, as has already been done, does not extend to a statement about every n.
Formalization scope
Matrices are real (ℝ), not complex. The complex structure enters only through the fixed real matrix J.
Matrices are indexed by Fin n ⊕ Fin n (PassivityUn.Blk n) rather than Fin (2n), so that block decomposition via Mathlib's Matrix.fromBlocks is direct. The first copy of Fin n indexes the upper/left blocks.
Each condition is defined as the kernel of a linear map: symmetry as the kernel of W↦WT−W, and commuting with J as the kernel of W↦WJ−JW. Both are therefore subspaces by construction, with no hand-written closure proofs.
Dimension is Module.finrank ℝ. The ambient space is finite-dimensional, so the convention that finrank of an infinite-dimensional space is 0 never applies.
The case n=0 is included, and there the statement reads 0=0. This is not a trivialization: the claim is quantified over all n, and every n≥1 is a nontrivial instance.
M4 is stated with natural-number division and truncated subtraction. Both are exact here, because n(n±1) is always even and n⋅(n−1)=0 when n=0.
The development needs only Mathlib's block matrices, transpose, linear maps and finrank. The block-characterization lemmas (M2, M3) are reusable for any statement relating real matrices commuting with J to complex matrices. Contributions are welcome on the milestones and on the assembling isomorphism.
Selected references
B. C. Hall, Lie Groups, Lie Algebras, and Representations: An Elementary Introduction, 2nd ed., Graduate Texts in Mathematics 222, Springer, 2015. https://doi.org/10.1007/978-3-319-13467-3
g-factor (physics): the classical gyromagnetic baseline and g-factor conventionsTextbook
Motivation
The g-factor of a particle, nucleus or atom is the dimensionless number that measures its magnetic moment in units of the moment a classical particle with the same charge and angular momentum would have. Because it is both measured and computed to very high precision, small discrepancies between measured and predicted g-factors are used as tests of the Standard Model; the electron g-factor is known to about two parts in 1013, and the muon g-factor has for two decades shown a several-standard-deviation tension between experiment and theory.
This mission formalizes the mathematical content of the Wikipedia article g-factor (physics): the definitions it gives, the elementary identities it states between them, and the numerical claims it makes about the experimental data.
Setting
All vectors live in R3, written as functions {0,1,2}→R, with component 2 playing the role of the z component.
Dirac particle. For charge e, mass m, spin angular momentum S and g-factor g, the spin magnetic moment is μ=g2meS (diracMagneticMoment).
Nuclear magneton convention. With μN=2mpeℏ (nuclearMagneton), the moment of a nucleon or nucleus with spin I is μ=gℏμNI (nuclearMagneticMoment).
Bohr magnetonμB=2meeℏ (bohrMagneton) and electron orbital momentμL=−gLℏμBL (electronOrbitalMagneticMoment).
Classical point charges. For finitely many point particles with charges qi, masses mi, positions ri and velocities vi, the magnetic moment is μ=∑i2qiri×vi (classicalMagneticMoment) and the angular momentum is L=∑imiri×vi (classicalAngularMomentum).
Formalization targets
Goal: the classical baseline has g=1
The article defines the g-factor as the ratio of a particle's magnetic moment to the one "expected of a classical particle of the same charge and angular momentum", and says gL=1 "by a quantum-mechanical argument analogous to the derivation of the classical magnetogyric ratio". The goal makes that classical baseline precise: for a system whose charge-to-mass ratio is the same for every particle (qi=κmi, mi>0), with total charge Q=∑iqi and total mass M=∑imi,
μ=1⋅2MQL.
Milestones
The two forms of the nuclear-magneton formula agree: gℏμNI=g2mpeI.
For a particle of proton mass, the Dirac-particle and nuclear-magneton definitions assign the same g-factor.
The z component of the electron orbital moment is −gLμBmℓ, which equals −μBmℓ when gL=1.
The E821 muon result differs from the quoted theoretical prediction by between 3.4 and 3.5 combined standard deviations.
The relative standard uncertainties in the article's CODATA table round to the values printed there.
Significance
The goal is the statement that fixes the normalization of every g-factor in the article: it says that a classical body with uniform charge-to-mass ratio has gyromagnetic ratio exactly Q/(2M), i.e. g=1, so any deviation from 1 (such as ge≈−2) is a genuinely non-classical effect. The milestones pin down the conventions (Dirac versus nuclear magneton, sign conventions for the electron orbital moment) and check the numerical claims the article makes from its data. None of these results is new; the contribution is a machine-checked, convention-explicit record of them.
Difficulty
The mathematics is elementary. The work is in the conventions: division by a mass or by ℏ is total in Lean and returns 0 at 0, so positivity of masses and of ℏ must be carried explicitly, and the numerical milestones must be stated with the exact decimal values of the source rather than rounded ones.
Formalization scope
Vectors are Fin 3 → ℝ; the cross product is Mathlib's crossProduct. Component index 2 is the z axis.
Physical constants are free real parameters; no numerical value of e, ℏ or any mass is fixed. Where the source's formula divides by a quantity, the statement assumes it nonzero or positive.
Uncertainties written as x(dd) in the article are read as a standard uncertainty in the last two digits of x; the E821 milestone combines the experimental and theoretical uncertainties in quadrature, which is the standard convention but is not spelled out in the article.
Not formalized: the finite-nuclear-mass formula gL=1−1/M and the Landé factor gJ, which the article quotes from other sources without derivation.
G. W. Bennett et al. (Muon g−2 Collaboration), Final report of the E821 muon anomalous magnetic moment measurement at BNL, Phys. Rev. D 73, 072003 (2006). https://doi.org/10.1103/PhysRevD.73.072003
Flow Matching Theorem 1: Marginal Continuity EquationResearch Paper
From conditional motion to a marginal probability path
Flow matching models a changing probability distribution using a time-dependent velocity field. A conditional model specifies a density and a velocity separately for each conditioning point. The mathematical question is whether those conditional descriptions determine a velocity for the mixture distribution. This mission concerns the continuity-equation formulation of Theorem 1 of Lipman, Chen, Ben-Hamu, Nickel, and Le, Flow Matching for Generative Modeling (ICLR 2023). The source is arXiv:2210.02747v2, Section 3.1 and Appendix A.
Densities, velocities, and probability flux
Fix a natural number d and let E=Rd. The conditioning distributionQ is a Borel probability measure on E. At time t, position x, and conditioning point z, write ρ(t,x,z) for the conditional density and v(t,x,z)∈E for the conditional velocity. The variable x is integrated against Lebesgue measure; z is integrated against Q. These roles remain distinct even though both variables take values in the same space.
The conditional flux is F(t,x,z)=ρ(t,x,z)v(t,x,z). The marginal density, marginal flux, and marginal velocity are defined by
These definitions express equations (6) and (8) using a probability measure rather than a data-density function. This representation also allows discrete conditioning distributions. Every conditional density is strictly positive and normalized on 0≤t≤1, jointly measurable in (x,z), and integrable in z at each fixed (t,x).
The divergence of a differentiable vector field is the sum of the diagonal entries of its derivative. A density and velocity satisfy the classical continuity equation when their flux is spatially differentiable and the density has time derivative equal to minus that divergence.
Formalization targets
The goal asserts that p(t,⋅) is a positive probability density for every t∈[0,1] and that
∂tp(t,x)+divx(p(t,x)u(t,x))=0(0<t<1,x∈E).
The hypotheses require the conditional continuity equation for Q-almost every conditioning point, at each interior time and spatial point. They also specify a sufficient local domination package for differentiation under the integral. This is an explicit classical interpretation of the regularity qualification in the proof of Theorem 1.
Four supporting targets isolate the mathematical assertions used by this formulation: the probability-density property of equation (6); time differentiation under the conditioning integral; spatial divergence under the conditioning integral; and the velocity/flux identity corresponding to equation (8). The source contains these equations and operations rather than separately numbered supporting lemmas, so the milestone titles identify the relevant equation or proof passage.
What completing the formalization provides
The deliverable is a checked interface for passing from a measurable family of conditional continuity equations to the continuity equation of its mixture. It records which variables are differentiated, which measure is used for averaging, where positivity is needed, and which assumptions justify each analytic operation. The time and spatial differentiation lemmas are stated for general measures and integrands, making them reusable outside this particular probability model.
The mathematical result is already proved in the cited paper. The uploaded theorem items are open formalization targets, with explicit proof placeholders. Successful local compilation checks their types and imports; it does not establish their conclusions. The definition module contains no proof placeholders.
Analytic obligations
Pointwise differentiability of every conditional function does not by itself justify differentiating an integral over the conditioning variable. The regularity predicates therefore require a neighborhood independent of that variable, an integrable bound for the derivative norm throughout that neighborhood, and almost-everywhere measurability of the integrand and derivative. Time and space receive separate predicates because their derivatives take values in different spaces.
There is also a distinction between density normalization in x and integrability in z at a fixed position. The formal assumptions record both. A probability measure on the conditioning space does not make every measurable function integrable. These conditions prevent the totalized Bochner integral from silently supplying a default value where an intended integral fails to exist.
Formalization scope
Space is represented by Fin d → ℝ, with its standard finite-product Borel structure and Lebesgue measure. Its norm is the standard product norm used by mathlib. All finite dimensions, including dimension zero, are included. Time-dependent functions are defined on all real times, while density assumptions apply on the closed unit interval and derivative conclusions apply on its interior. No endpoint time derivative is asserted.
The regularity package is one sufficient realization of the source's Leibniz-rule assumption, not a claim to the weakest possible hypotheses. Conditional continuity equations may hold almost everywhere in the conditioning variable; their exceptional sets may depend on the fixed time and position. Spatial differentiability of the marginal flux is part of the conclusion, so the equation cannot be satisfied merely through the default value of an undefined derivative.
The target is the PDE formulation. It does not assert existence of a global ODE flow, uniqueness of transported measures, or equality with a flow pushforward. Those require a separate transport development. It also asserts no endpoint approximation to a data distribution and no theorem about optimization, neural networks, or Gaussian paths. No marginal continuity equation or differentiation–integration interchange is assumed as an input.
Required infrastructure consists of Bochner integration, finite-dimensional differentiation, finite sums of derivative coordinates, and product-measure integration. Contributions may prove the supporting targets or the goal directly while preserving their statements and the distinction between classical PDE and flow-transport claims.
Selected references
Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow Matching for Generative Modeling. ICLR 2023. arXiv:2210.02747v2, Section 2, Section 3.1, Theorem 1, equations (6), (8), and (26), and Appendix A's proof of Theorem 1.
Caesium Standard: the SI base units from the defining constantsTextbook
Motivation
Since the 2019 revision of the SI, every unit in the system is fixed by assigning exact
numerical values to seven defining constants: the caesium hyperfine transition frequency
ΔνCs, the speed of light c, the Planck constant h, the elementary charge e,
the Boltzmann constant k, the Avogadro constant NA and the luminous efficacy
Kcd. Six of the seven base units — every one except the mole — therefore carry
ΔνCs in their definition, and the caesium standard is the anchor of the whole
system. The first caesium clock was built by Louis Essen and Jack Parry in 1955
(Nature 176, 280); the caesium frequency was tied to the
ephemeris second by Markowitz, Hall, Essen and Parry in 1958
(Phys. Rev. Lett. 1, 105); the 13th CGPM adopted the
caesium definition of the second in 1967, the CIPM added the "atom at rest at 0K"
qualification in 1997, the metre was redefined in terms of c and the second in 1983, and the 26th
CGPM fixed the present constant-based system in 2018, effective 2019
(Resolution 1 (2018)).
The audience for this mission is anyone who relies on those conversion factors being right:
metrology, unit-aware computation, and formal libraries that want a machine-checked statement of
what the SI actually fixes, rather than a table copied by hand.
Setting
All seven defining constants are exact decimal numbers, hence exact rationals:
each understood as the numerical value of the constant in its SI unit (hertz, metres per second,
joule seconds, coulombs, joules per kelvin, reciprocal moles, lumens per watt).
From these one forms the four parameters of the caesium-133 hyperfine transition radiation:
its period, wavelength, photon energy and photon mass equivalent. The optical units bring in one
further radiation, of frequency νopt=5.4×1014 Hz, with period
topt=1/νopt, wavelength λopt=c/νopt,
photon energy Eopt=hνopt and luminous energy per photon
KcdEopt.
Formalization targets
Goal — the seven base units in the defining constants
Each line is the assertion that the displayed expression has numerical value exactly 1.
Milestones
The radiation parameters (ΔtCs and the 1967 definition of the second;
ΔλCs and the claim that it lies between 3.26 and 3.27 cm;
ΔECs=6.09110229711386655×10−24 J;
ΔMCs); the individual base-unit relations for the kilogram, ampere, kelvin and
candela; the derived units of energy, power, force, pressure and absorbed dose; the
electromagnetic units, including 1Ω as an exact multiple of h/e2; the optical units
and the parameters of the 540 THz radiation; the katal; and finally the dependence statement:
the formulas for the mole and the coulomb return the same value whatever the caesium frequency,
while those for the second, metre, kilogram, ampere, kelvin and candela separate distinct positive
frequencies.
Significance
What the results give is a machine-checked transcription of the exact arithmetic content of the
2019 SI: every coefficient in the table of base and derived units, checked against the defining
constants rather than against another table. Downstream, a unit-conversion or dimensional-analysis
development can cite these identities instead of re-deriving or re-typing sixteen-digit decimals,
where a single transposed digit is a silent error.
What formalizing adds is faithfulness checking, not new mathematics. Every statement in this
mission is a true identity between exact rational numbers; none of them is open in the
mathematical sense.
Difficulty
This mission is arithmetically easy on purpose, and that should be stated plainly: each target
is an equality between explicit rational numbers, and a solver who unfolds the constants and
normalizes the arithmetic will close it. There is no analytic content, no limit, no inequality
beyond the two decimal bounds on ΔλCs.
The real failure mode is transcription. The coefficients carry up to 51 significant digits
(the pascal), they are quotients of two decimals rather than single numbers, and the source
displays several of them in a layout where a numerator and a denominator can easily be swapped.
A statement that is off in the last digit is false, not approximately true, and is the kind of
defect this mission exists to exclude.
Formalization scope
Every quantity is modelled as an element of Q: the numerical value of the physical
quantity in the corresponding SI unit. Dimensions are not tracked. A clause such as
"1kg=αhΔνCs/c2" is formalized as the numerical
identity αhΔνCs/c2=1, the unit bookkeeping being carried in the
prose only; a development that wants dimensional safety must add a dimension layer on top. Decimal
literals are exact rationals, not floating-point numbers, and no real-number approximation enters.
The statements are closed identities between explicit rationals, so none of them can be vacuous:
each is either true or false, with no hypothesis to satisfy and no quantifier to exploit. The one
quantified statement — the dependence of the unit formulas on the caesium frequency — ranges over
all positive rationals and asserts non-equality in six cases and equality in two.
The definition layer is a single file of exact rational constants and the caesium radiation
parameters; it is reusable by any later unit-related development. Contributions that would extend
the mission usefully: a dimension-tracking layer over these constants, and the pre-2019
definitions (the krypton-86 metre, the IPK kilogram, the triple-point kelvin) stated in the same
style for comparison.
L. Essen, J. V. L. Parry, "An Atomic Standard of Frequency and Time Interval: A Caesium
Resonator", Nature176 (1955) 280–282 — https://doi.org/10.1038/176280a0
W. Markowitz, R. Hall, L. Essen, J. Parry, "Frequency of Cesium in Terms of Ephemeris Time",
Physical Review Letters1 (1958) 105 — https://doi.org/10.1103/PhysRevLett.1.105
Understanding Machine Learning VII: Boosting and AdaBoostTextbook
Motivation
Boosting answers a question raised by Kearns and Valiant: can a learner that is only slightly better than random guessing be turned into one that is arbitrarily accurate? Chapter 10 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) defines γ-weak learnability (Definition 10.1), the PAC requirement with the accuracy ϵ replaced by the fixed value 1/2−γ, and presents AdaBoost, the algorithm of Freund and Schapire that, given weak hypotheses, reweights the training set round by round and outputs a weighted majority vote. The chapter's main result (Theorem 10.2) is that the training error of AdaBoost's output decreases as e−2γ2T in the number of rounds. Since the output is a halfspace over the predictions of T base hypotheses, the chapter then bounds the VC-dimension of that class (Lemma 10.3), so that the number of rounds becomes a knob for the bias–complexity tradeoff. Example 10.1 shows a concrete weak learner, ERM over decision stumps for the class of 3-piece classifiers on the line, and the chapter remarks that, statistically, weak learnability is no easier than strong learnability: a class of infinite VC-dimension is not weakly learnable either.
Setting
The framework is that of Missions I and IV: binary classification over a domain X with the 0–1 loss, distributions D over X with a labeling function f, learners as functions of the sample, the VC-dimension, and ERM. Labels and hypotheses are Boolean, with ±1 values obtained through sgn(true)=1, sgn(false)=−1, and sign(z) is true exactly when z>0. A γ-weak learner for H with the function mH:(0,1)→N returns, for every δ, every D and every measurable f realizable by H, a hypothesis with L(D,f)(h)≤1/2−γ with probability at least 1−δ once m≥mH(δ); the failure event is bounded in outer measure as in Definition 3.1.
AdaBoost is formalized as a deterministic function of the sample S=(x1,y1),…,(xm,ym) and of the sequence of weak hypotheses h0,h1,… that the weak learner returned. The distributions are defined by recursion: D(0) is uniform, ϵt=∑iDi(t)1[ht(xi)=yi], wt=21log(1/ϵt−1), and Di(t+1)∝Di(t)exp(−wtyiht(xi)); the output after T rounds is x↦sign(∑t<Twtht(x)). Rounds are indexed from 0, so D(0) is the book's D(1). The class L(B,T) of Equation (10.4) consists of the functions x↦sign(∑t=1Twtht(x)) with ht∈B. Decision stumps over R are the threshold functions x↦[θ<x] and their negations x↦[x≤θ]; a 3-piece classifier is b outside [θ1,θ2] and −b inside, with θ1<θ2.
Formalization targets
Goal: Theorem 10.2
If γ>0 and every round t<T has 0<ϵt≤1/2−γ, then the empirical 0–1 risk of AdaBoost's output after T rounds is at most exp(−2γ2T).
Milestones
§10.1. A class of infinite VC-dimension is not γ-weak-learnable for any γ>0 (domain with measurable singletons, measurable hypotheses).
Example 10.1. There is one sample-size function with which every ERM learner over the decision stumps is a 1/12-weak learner for the 3-piece classifiers.
Exercise 10.3. For a nonempty sample and ϵt∈(0,1), the error of ht under D(t+1) is exactly 1/2.
Lemma 10.3. If T≥3 and VCdim(B)=d≥3, then VCdim(L(B,T))≤T(d+1)(3log(T(d+1))+2).
Further item: Exercise 10.4 (1), VCdim(B)≤VCdim(L(B,T)) for T≥1.
Significance
Theorem 10.2 is the reason AdaBoost works and the template for every analysis of boosting: a potential function, here m1∑ie−yift(xi), bounds the 0–1 training error and contracts by the factor 2ϵt(1−ϵt)≤1−4γ2 at every round. Lemma 10.3 supplies the other half of the picture, an estimation-error bound growing only like T⋅VCdim(B) up to logarithms, so that Theorem 6.8 turns the pair into a generalization guarantee for boosting. The remark of §10.1 places weak learning in the statistical landscape of Part I: the VC-dimension characterizes it too, and the gain of boosting is computational.
Nothing here is machine-checked. Two points where the book's text needs care are built into the statements. The weight wt is undefined when ϵt=0, and the algorithm's normalization then divides 0 by 0; in Lean the logarithm of a negative number is 0, so with ϵt=0 the formal algorithm would ignore a perfect weak hypothesis and the bound could fail. The theorems therefore assume ϵt>0, which is the case in which the book's formulas are defined. And the book's derivation of "infinite VC-dimension implies not weakly learnable" from the lower bound of Theorem 6.8 at ϵ=1/2−γ uses that bound outside the range in which Chapter 28 proves it; the statement itself is true, by the km-point form of the No-Free-Lunch argument (Exercise 5.3 of Mission III) and Lemma B.1.
Difficulty
Exercise 10.4 (1) is a one-line embedding of B into L(B,T) with the weights (1,0,…,0) and is the entry point. Exercise 10.3 is the computation of the book: after the update, the weight of the mistakes of ht is ewtϵt and the weight of the correct examples is e−wt(1−ϵt), and with ewt=(1−ϵt)/ϵt these are equal. Theorem 10.2 needs, by induction on the round, the closed form Di(t)=e−yift(xi)/∑je−yjft(xj) of the distribution, the pointwise bound 1[sign(f(x))=y]≤e−yf(x) for the sign convention used, the telescoping product (10.2), the identity Zt+1/Zt=2ϵt(1−ϵt), the monotonicity of a(1−a) on [0,1/2] and 1−a≤e−a. Lemma 10.3 counts dichotomies: Sauer's lemma bounds the restrictions of B to a shattered set by (em/d)d, choosing T of them gives (em/d)dT, the halfspaces of RT contribute (em/T)T by Theorem 9.2, and the inequality 2m≤m(d+1)T is solved with Lemma A.1; the finite-VC lower bound m≤d+1 handles small m, and the numeric slack of the book's chain must be checked. Example 10.1 combines a geometric observation, that one of the three regions of a 3-piece classifier has mass at most 1/3 and a stump agrees with the other two, with the agnostic guarantee for ERM over the stumps from Theorem 6.7, applied with accuracy 1/12; the best stump may only approach error 1/3 because constant functions are not stumps, and the slack absorbs this. The §10.1 remark is the argument sketched above.
Formalization scope
AdaBoost is a function of the sample and of the returned weak hypotheses; the weak learner's randomness and its failure probability (Remark 10.2) are not modelled, and Theorem 10.2 is the deterministic statement the book proves. Rounds are indexed from 0. The output uses sign(0)= negative, consistently with Mission VI. The class L(B,T) is a set of functions, so Lemma 10.3 is a statement about the VC-dimension of Mission IV, with the bound taken in N∪{∞} through the integer part of the real right-hand side and the natural logarithm. Decision stumps are closed under negation, as the book's sign(x−θ)⋅b; constant functions are not stumps. The efficient ERM for decision stumps (§10.1.1), the face-recognition features (§10.4), Exercises 10.1, 10.2, 10.4 (2)–(3) and 10.5 are not stated. The claims of §10.3 that piecewise-constant classifiers with T pieces lie in L(stumps,T) and that this class shatters T+1 points depend on treating sign(x−(−∞)) as a stump and on the sign convention; with real thresholds, L(stumps,2) does not shatter three points under either convention, so these claims are not stated.
Trivializing readings are excluded: the weak-error hypotheses are strict where the book's formulas require it, the VC bounds are in N∪{∞}, and the weak-learner guarantee quantifies over all distributions and all realizable labelings. Welcome contributions: the closed form of D(t), the contraction identity for Zt+1/Zt, and the dichotomy count behind Lemma 10.3.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 10. doi:10.1017/CBO9781107298019
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), 1997. doi:10.1006/jcss.1997.1504
R. E. Schapire, The strength of weak learnability, Machine Learning 5(2), 1990. doi:10.1007/BF00116037
M. Kearns, L. Valiant, Cryptographic limitations on learning Boolean formulae and finite automata, Journal of the ACM 41(1), 1994. doi:10.1145/174644.174647
R. E. Schapire, Y. Freund, Boosting: Foundations and Algorithms, MIT Press, 2012.
Understanding Machine Learning VI: Linear Predictors, the Perceptron and Least SquaresTextbook
Motivation
Part II of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) turns from the theory of learnability to hypothesis classes that can actually be learned by algorithms, and it starts with the family that almost every practical method is built on: linear predictors. Chapter 9 introduces the affine functions Ld and the three classes obtained by composing them with a link: halfspaces for classification, linear regression for real-valued prediction, and logistic regression in between. For each class it gives an ERM algorithm and the guarantee that goes with it. For halfspaces in the separable case the algorithm is Rosenblatt's Perceptron, and the guarantee is the classical mistake bound (Theorem 9.1): the number of updates is at most (RB)2, where R bounds the data and B is the norm of the smallest vector separating it with margin one. The chapter then computes the VC-dimension of halfspaces (Theorems 9.2 and 9.3), which by the fundamental theorem of Mission IV makes them learnable, derives the Least Squares normal equations for regression, and observes that the logistic loss is convex, the property later chapters exploit.
Setting
Vectors live in Rd with its Euclidean inner product and norm. The affine functions are hw,b(x)=⟨w,x⟩+b, homogenous when b=0; a halfspace hypothesis is x↦sign(⟨w,x⟩+b), formalized as a Boolean predictor that is true exactly when ⟨w,x⟩+b>0 (the book leaves sign(0) unspecified; the VC computations do not depend on the convention). A sample (x1,y1),…,(xm,ym) with labels yi∈{±1} is separable if some w has yi⟨w,xi⟩>0 for all i; the constants of Theorem 9.1 are B=inf{∥w∥:∀i,yi⟨w,xi⟩≥1} and R=maxi∥xi∥. The Batch Perceptron starts at w(0)=0 and, while some example has yi⟨w(t),xi⟩≤0, adds yixi; since the algorithm may pick any mistaken example, a run is any sequence of updates obeying this rule, and the theorem is stated for all runs. For regression the loss is (h(x)−y)2 and the Least Squares system is Aw=b with A=∑ixixi⊤, written as the linear map w↦∑i⟨xi,w⟩xi, and b=∑iyixi. The logistic function is φsig(z)=1/(1+e−z) and the logistic loss is log(1+exp(−y⟨w,x⟩)). The learning-theoretic notions (ERM, PAC and agnostic PAC learnability, VC-dimension) are those of Missions I and IV.
Formalization targets
Goal: Theorem 9.1 (Perceptron convergence)
For a separable sample with labels in {±1}, every run of the Batch Perceptron of T iterations satisfies T≤(RB)2, and some run of at most (RB)2 iterations ends with yi⟨w(T),xi⟩>0 for every i.
Milestones
Equation (9.1). A sample is separable if and only if some w satisfies yi⟨w,xi⟩≥1 for all i.
Theorem 9.2. The VC-dimension of the homogenous halfspaces in Rd is d.
Theorem 9.3. The VC-dimension of the halfspaces in Rd is d+1.
Least Squares (9.6). The system Aw=b always has a solution, and w solves it if and only if hw is an ERM hypothesis for the squared loss over the homogenous linear predictors.
Further items: Exercise 9.3, the tightness of Theorem 9.1 (for every m a sample with R≤1, (BR)2≤m and a run of exactly m updates); the learnability of halfspaces by ERM, a consequence of Theorem 9.3 and the fundamental theorem; Exercise 9.2, A is invertible iff the xi span Rd; and the convexity of the logistic loss in w.
Significance
The Perceptron bound is one of the oldest results of learning theory (Novikoff 1962) and the model for every mistake bound in the online-learning chapters: it is independent of the dimension and of the number of examples, depending only on the geometry of the data through R and B. Theorems 9.2 and 9.3 are the first VC-dimension computations of a class used in practice and give, through Theorem 6.8, the sample complexity Θ((d+log(1/δ))/ϵ) of learning halfspaces. The normal equations are the algorithmic content of linear regression, and the convexity of the logistic loss is why logistic regression is tractable in the nonseparable case, where ERM for halfspaces with the 0–1 loss is hard.
Nothing here is machine-checked in this form. Mathlib has the inner-product geometry, the Cauchy–Schwarz inequality, linear algebra of finite-dimensional spaces and convexity of compositions, but neither the Perceptron nor the VC-dimension of halfspaces.
Difficulty
Equation (9.1) is a rescaling and the intended entry point. The convexity of the logistic loss is the composition of the convex function log(1+e−t) with the linear map w↦y⟨w,x⟩. Exercise 9.2 is the identification of the kernel of ∑i⟨xi,⋅⟩xi with the orthogonal complement of the span. The normal equations require showing that a convex quadratic is minimized exactly where its gradient vanishes, and that b lies in the range of A, which is the span of the xi. Theorem 9.1 is the book's proof: by induction on the run, ⟨w∗,w(T)⟩≥T and ∥w(T)∥2≤TR2 for any feasible w∗, then Cauchy–Schwarz, and finally the passage from a feasible w∗ to the infimum B; the existence clause follows because a run can be extended as long as the stopping condition fails and all runs are bounded. Theorem 9.2 is the linear-dependence argument of the book, with a case analysis on the signs of the coefficients and on which side is nonempty, and the shattering of the standard basis; Theorem 9.3 lifts it to Rd+1 by appending a constant coordinate. The learnability of halfspaces is Theorem 6.7 applied to a class that must be shown measurable, nonempty, of finite VC-dimension and pointwise separable; the last needs rational approximations (wn,bn) in which the offset moves below b more slowly than wn approaches w, so that boundary points keep their label.
Formalization scope
Halfspaces are Boolean predictors with sign(0) negative; the classes are sets of functions, so the VC-dimension is that of Mission IV. The Perceptron is a relation on sequences, not a program: this captures the algorithm's freedom to choose any mistaken example and makes the bound apply to all implementations. B is an infimum, which is attained (the feasible set is closed and the norm is coercive), but the theorem does not need attainment. R is a real supremum over the finite index set, equal to 0 for the empty sample, where every run has length 0. The Least Squares statement is about the homogenous class and the sample i↦(xi,yi), with ERM in the sense of Mission I; the bias term is handled by the book's reduction, appending a constant coordinate, and is not formalized separately. The learnability item states qualitative learnability and the ERM guarantee with an unspecified sample-complexity function; the quantitative rate is Theorem 6.8 of Mission IV. Linear programming (§9.1.1), the pseudo-inverse (§9.2.1), polynomial regression (§9.2.2), Exercises 9.1 and 9.4–9.6 are not stated.
Trivializing readings are excluded: labels are constrained to ±1, runs must start at 0 and update only on mistakes, the VC equalities are in N∪{∞}, and the ERM equivalence is a biconditional. Welcome contributions: the two Perceptron invariants as separate lemmas, the shattering of the standard basis, and the pointwise separability of halfspaces.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 9. doi:10.1017/CBO9781107298019
F. Rosenblatt, The perceptron: a probabilistic model for information storage and organization in the brain, Psychological Review 65(6), 1958. doi:10.1037/h0042519
A. B. J. Novikoff, On convergence proofs on perceptrons, Proceedings of the Symposium on the Mathematical Theory of Automata 12, 1962.
S. Agmon, The relaxation method for linear inequalities, Canadian Journal of Mathematics 6, 1954. doi:10.4153/CJM-1954-037-2
S. Ben-David, H. U. Simon, Efficient learning of linear perceptrons, Advances in Neural Information Processing Systems 13, 2001.
The fundamental theorem of Mission IV says that a class of binary classifiers is PAC learnable exactly when its VC-dimension is finite. That leaves out classes one would like to learn, such as all polynomial classifiers over the line, whose VC-dimension is infinite although each degree separately is learnable. Chapter 7 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) relaxes the definition. In nonuniform learnability (Definition 7.1) the sample size may depend on the hypothesis the learner is competing with: the learner must, for every h∈H, eventually do as well as h up to ϵ, but how soon may depend on h. The chapter's main result (Theorem 7.2) characterizes the nonuniformly learnable classes of binary classifiers as the countable unions of agnostic PAC learnable classes. The learning rule behind it is Structural Risk Minimization (SRM): write H=⋃nHn, weight the pieces, and minimize the empirical risk plus a confidence term that grows with the index (Theorems 7.3–7.5). Applied to a countable class described by a prefix-free code, SRM becomes the Minimum Description Length rule and yields a quantitative form of Occam's razor (Lemma 7.6, Theorem 7.7). The chapter closes the circle with a No-Free-Lunch result for the relaxed notion (Remark 7.2, Exercise 7.5).
Setting
The framework is that of Missions I, II and IV: examples in a domain Z, a hypothesis type with a class H, a loss ℓ, risk LD and empirical risk LS, learners as functions of the sample, the uniform convergence property with an explicit rate mHUC, agnostic PAC learnability, and for binary classification the 0–1 loss, the VC-dimension and pointwise separability. The new module adds Definition 7.1 with an explicit rate mNUL and, as in Definition 3.4, learners whose outputs lie in H; the same notion for a family of learners indexed by the confidence δ, since the SRM and MDL rules take δ as an input; the rate ϵn(m,δ)=inf{ϵ∈(0,1):mHnUC(ϵ,δ)≤m} of Equation (7.1), which is meaningful only when that set is nonempty; the index n(h)=min{n:h∈Hn} of Equation (7.4); the SRM rule as a minimizer of LS(h)+ϵn(h)(m,w(n(h))δ) over the admissible hypotheses, those whose index has positive weight and a defined rate; prefix-free description languages d:H→{0,1}∗ and the MDL rule; and shattering of an infinite set.
Formalization targets
Goal: Theorem 7.2
For a class H of measurable binary classifiers over a domain with measurable singletons, every subclass of which is pointwise separable, H is nonuniformly learnable if and only if there are classes Hn with ⋃nHn=H, each agnostic PAC learnable.
Milestones
Theorem 7.3. If H=⋃nHn is nonempty and each Hn has the uniform convergence property, then H is nonuniformly learnable (general loss).
Theorem 7.4. For weights w(n)∈[0,1] with partial sums at most 1, uniformly convergent pieces Hn with rates mHnUC, δ∈(0,1), any D and any m: with probability at least 1−δ, for every n with w(n)>0 at which ϵn(m,w(n)δ) is defined and every h∈Hn, ∣LD(h)−LS(h)∣≤ϵn(m,w(n)δ).
Theorem 7.5. With w(n)=6/(π2n2) and H0=∅, every family of learners implementing the SRM rule satisfies the nonuniform guarantee with rate mNUL(ϵ,δ,h)=mHn(h)UC(ϵ/2,6δ/(πn(h))2).
Lemma 7.6 (Kraft). For a prefix-free set S of binary strings, every finite subfamily satisfies ∑σ2−∣σ∣≤1.
Theorem 7.7. For a prefix-free description language on a class with a [0,1]-valued loss, m≥1 and δ>0: with probability at least 1−δ, every h∈H satisfies LD(h)≤LS(h)+(∣h∣+ln(2/δ))/(2m).
Further items: nonuniform learnability is implied by agnostic PAC learnability (§7.1); a nonuniformly learnable class of binary classifiers is a countable union of classes of finite VC-dimension (Exercise 7.5 (1)–(2)); a class shattering an infinite set admits no countable cover by classes of finite VC-dimension (Exercise 7.5 (3)) and is not nonuniformly learnable; over an infinite domain the class of all measurable classifiers is not nonuniformly learnable (Remark 7.2).
Significance
Theorem 7.2 is the second characterization theorem of the book's Part I and the one that explains why model selection works: any class that can be stratified into learnable pieces is learnable in the nonuniform sense, with the price of not knowing the index paid in sample size rather than in principle. SRM is the abstract form of every penalized learning rule, and the MDL bound of Theorem 7.7 is the cleanest instance, a bound in which the only property of the hypothesis that matters is the length of its description. Remark 7.2 shows the relaxation is not free: even nonuniformly, no learner handles all classifiers over an infinite domain.
Nothing here is machine-checked. The chapter's arguments are short but they combine everything before them: Hoeffding, the union bound with weights, the VC lower bound of Corollary 6.4 and the fundamental theorem. Three places where the book's statements need care are recorded in the formalization: the rate ϵn is an infimum that may be undefined for small m; the SRM rule takes δ as an input and so is a family of learners; and the fundamental theorem's uniform-convergence direction needs a measurability condition, which appears in Theorem 7.2 as hereditary pointwise separability.
Difficulty
The relaxation remark is a direct comparison of two definitions. Kraft's inequality is the coin-tossing argument of the book or an induction on the maximal length: it is the intended entry point. Theorem 7.4 is Theorem 7.3's engine: for each index and each ϵ in the set of Equation (7.1), the uniform convergence property bounds the failure by w(n)δ; the passage from "every ϵ in the set" to the infimum uses continuity of the outer measure along an increasing union; the union over n uses countable subadditivity and the partial-sum condition. Theorem 7.5 is Theorem 7.4 on the good event together with the two inequalities of the book's proof, using that the target is admissible when m≥mHn(h)UC(ϵ/2,w(n(h))δ) and that admissibility of the SRM output gives the bound for it. Theorem 7.3 asks for a single learner: SRM with a confidence schedule δm→0 chosen so that, for each fixed index, the rate at level δm eventually falls below any ϵ, together with an approximate minimizer within 1/m; the target hypothesis is admissible for m large. Theorem 7.7 is Theorem 7.4 with singleton pieces and the weights 2−∣h∣, a one-sided Hoeffding bound for each h, and Kraft's inequality. Exercise 7.5 (3) is the combinatorial construction of the book's hint, disjoint finite subsets Kn of the shattered set with ∣Kn∣>VCdim(Hn) and a labeling that no Hn realizes. The first half of Theorem 7.2 is Corollary 6.4 applied to the nonuniform learner at fixed ϵ0,δ0, with constants chosen so that the two probability bounds actually contradict; the second half is the fundamental theorem on each piece followed by Theorem 7.3.
Formalization scope
Learners output hypotheses in H, in Definition 7.1 as in Definition 3.4. The rate ϵn is an infimum over the set of Equation (7.1), and every statement that uses it is guarded by the nonemptiness of that set; the weight w(n) may be 0, and H0=∅ encodes the book's indices 1,2,…. The SRM rule minimizes over admissible hypotheses, and an SRM family is one that returns an admissible minimizer whenever some hypothesis is admissible, which is the book's assumption that the argmin is attained (automatic for the 0–1 loss). Theorem 7.4's sum condition is on partial sums, and Kraft's inequality is on finite subfamilies, so no divergent series is silently zero. Theorem 7.7 assumes a [0,1]-valued loss and m≥1. The binary-classification results assume measurable singletons and measurable hypotheses; Theorem 7.2 also assumes every subclass pointwise separable, which every class over a countable domain satisfies. Definition 7.8 (consistency) and the Memorize algorithm of §7.4 are not stated.
Trivializing readings are excluded: outputs in H keep the risk an honest integral, the rate is never a junk infimum of the empty set, and the failure events are bounded in outer measure. Welcome contributions: a reusable weighted union bound over a countable family of uniform-convergence events, the continuity argument for the infimum rate, and the shattered-set combinatorics of Exercise 7.5.
Selected references
S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 7. doi:10.1017/CBO9781107298019