A Lean 4 / Mathlib formalisation of matching upper and lower bounds for recovery from
adaptively chosen continuous measurements, in the noise-free setting. The lower bound is
the main result of the preprint
A Borsuk–Ulam theorem for adaptive continuous measurements,
the upper bound that of Krieg, Novak and Ullrich in
Proc. Amer. Math. Soc. Together they
determine the minimal number of measurements up to one, and exactly when the dimension is a
power of two. The project builds without sorry, and every theorem uses only the three
axioms Mathlib relies on throughout (propext, Classical.choice, Quot.sound).
- Blueprint (the mathematics, with the Lean name at every statement)
- Blueprint as PDF
- Dependency graph (own design)
- Dependency graph (leanblueprint)
You want to know a vector x of a d-dimensional real normed space, up to an error
ε in the norm. You cannot see x; you may only compute real numbers
λ₁(x), …, λₙ(x). How large must n be?
- If the
λᵢare linear,dmeasurements are needed, even if each is chosen after seeing the previous values: with fewer, a whole affine subspace is consistent with what has been observed. - If the
λᵢare continuous but fixed in advance,dare needed again, by the Borsuk–Ulam theorem: with fewer, some antipodal pair, at distance2R, produces identical values. - If the
λᵢare continuous and chosen adaptively,⌈log₂ d⌉ + 1measurements suffice for arbitrary accuracy, and⌈log₂(d+1)⌉are necessary.
Adaptivity and nonlinearity together bring the count from d down to ⌈log₂ d⌉ + 1. The
information map x ↦ (λ₁(x), …, λₙ(x)) of an adaptive scheme is in general
discontinuous, and the Borsuk–Ulam theorem speaks about continuous maps.
An adaptive scheme (ContMeasurements.AdaptiveScheme) on a topological space X is a
family of functionals fct k y : X → ℝ, one for each number k of values already observed
and each vector y : Fin k → ℝ of those values. Each functional fct k y is continuous
as a function of the point x, while the choice of the functional may depend on the
observed values y in any way whatsoever; this freedom is what makes the scheme
adaptive. The information map S.info n x : Fin n → ℝ evaluates the
first n measurements in sequence, and an algorithm is Φ ∘ S.info n with an arbitrary
reconstruction map Φ. The module docstring of ContMeasurements/Scheme.lean explains the
three conventions the development fixes.
Throughout, E is a finite-dimensional real normed space of dimension d, and S is an
adaptive scheme on it. Nat.clog 2 d is Mathlib's ⌈log₂ d⌉.
-
Lower bound. If
2ⁿ ≤ d, then for every scheme and every radiusR > 0somexwith‖x‖ = RsatisfiesS.info n x = S.info n (-x):nmeasurements cannot tell an antipodal pair apart (exists_norm_eq_and_info_eq_info_neg). Hence every reconstructionΦerrs by at leastRsomewhere on that sphere (exists_norm_eq_and_le_norm_sub), and a scheme that does distinguish antipodes needsd + 1 ≤ 2ⁿ(AdaptiveScheme.DistinguishesAntipodes.finrank_add_one_le_two_pow). -
The covering proposition carrying that bound: if
nmeasurements separate antipodes on a compact symmetric set, that set is covered by2ⁿ - 1split sets (AdaptiveScheme.DistinguishesAntipodes.hasSplitCover), by way of the halving lemma (hasSplitCover_two_mul_of_forall_fiber). The least such number is the covering form of the Krasnosel'skiĭ genus. This step uses compactness alone. -
Borsuk–Ulam, proved here combinatorially. Tucker's lemma on the triangulation of the integer cube (
GridSimplex.tucker) gives the antipodal theorem for the cube (borsukUlam_cube), then the odd-map form on the Euclidean sphere (borsukUlam), and finally the form the lower bound uses: for a continuous oddΨ : E → ℝᵏwithk < dand anyR > 0there is anxwith‖x‖ = RandΨ x = 0(Function.Odd.exists_norm_eq_and_eq_zero_of_lt_finrank). -
Upper bound. If
0 < d ≤ 2ᵏ, then for everyε > 0there are a scheme and a reconstruction with‖x - Φ (S.info (k + 1) x)‖ ≤ εfor everyx ∈ E(exists_recovery_scheme). In particular⌈log₂ d⌉ + 1measurements suffice (exists_recovery_scheme_clog); the maximum norm onℝᵈis the caseexists_recovery_scheme_pi. -
The three ingredients of the upper bound. A Lebesgue cover of
ℝᵐbym + 1colors, with pieces of diameter at most3/2and pieces of one color at distance at least1/(4(m+2))from each other (ColoredCover.lebesgue), used for the firstm = d - 1coordinates, so that it hasdcolors; one measurement that names a piece of a given color by an integer value (exists_identification) and carries the last coordinate in its fractional part, through the logistic function; and bisection, which joins the schemes for at most2^Lcolor classes into one for their union at the cost ofLfurther measurements (exists_bisection_scheme). -
Both bounds together.
minMeasurements E R εis the leastnadmitting a scheme with error at mostεon the ball of radiusR. Ford > 0and0 < ε < R,⌈log₂(d+1)⌉ ≤ minMeasurements E R ε ≤ ⌈log₂ d⌉ + 1(
clog_le_minMeasurements_and_le, whose halves areclog_le_minMeasurementsandminMeasurements_le; the counting form of the lower half isfinrank_add_one_le_two_pow_minMeasurements). The upper half needs onlyε > 0. The two bounds meet whendis a power of two, whereminMeasurements E R ε = k + 1ford = 2ᵏ(minMeasurements_eq_of_finrank_eq_two_pow), and differ by one otherwise. Ford = 2andd = 4, for instance, the answer is2and3.
The lower bound rests on Borsuk–Ulam; the upper bound and the covering proposition are elementary. Everything else is in the blueprint, with its Lean name at every statement.
The Palomar registry re-checks a registered proof at a
fixed commit. The lower bound, the upper bound and the two bounds on minMeasurements
(exists_norm_eq_and_info_eq_info_neg, exists_recovery_scheme,
clog_le_minMeasurements_and_le and minMeasurements_eq_of_finrank_eq_two_pow) are
registered together as
PALOMAR-2026-11-27-000012,
checked at commit
4905ab3.
Two libraries. BasicResults holds the general mathematics the theory consumes: every
statement there is about metric geometry, equivariant topology or the real line, a
candidate for Mathlib, and the results live in root namespaces as a Mathlib contribution
would. It contains split covers and the
halving lemma, the triangulation of the integer cube, Tucker's lemma, Borsuk–Ulam, colored
covers with the Lebesgue cover, and the logistic function with its inverse;
MathlibCandidates.md lists what could be upstreamed.
ContMeasurements holds the theory itself: the model, the lower bound with its covering
proposition, bisection and identification, the upper bound, and the minimal number of
measurements. The blueprint states the results of the two papers in seven chapters and
proves the Borsuk–Ulam theorem in an appendix, which the dependency graph shows as a
block. A third library, Palomar, holds the registry submission: a Challenge module
states the advertised theorems on Mathlib alone, with sorry in place of the proofs as the
registry format requires, and a Solution module proves them from the development. Build
it separately with lake build Palomar.
Names follow the Mathlib conventions: UpperCamelCase for types and Prop-valued
definitions, lowerCamelCase for data, snake_case for theorems, spelled out of the
statement with the conclusion first and the hypotheses after of_.
Requires elan. The Lean version is pinned in
lean-toolchain and Mathlib in lake-manifest.json, so a clone builds against Lean /
Mathlib v4.36.0:
lake exe cache get # downloads the prebuilt Mathlib oleans
lake build # builds the projectRun lake from inside this folder, since elan reads lean-toolchain from the working
directory, and do not run lake update: it re-resolves the dependencies and makes the
build non-reproducible. Both libraries pass the Mathlib style linter, which checks among
other things that every declaration is documented and that no hypothesis goes unused:
lake exe runLinter BasicResults
lake exe runLinter ContMeasurementsThe blueprint follows the
leanblueprint convention and needs a TeX
installation, graphviz for the dependency graph, and the leanblueprint package:
leanblueprint pdf # blueprint/print/print.pdf
leanblueprint web # blueprint/web/index.html and the dependency graph
python blueprint/scripts/check_lean_decls.py --output check_decls.lean
lake env lean check_decls.lean # every \lean{Decl} must compileOn Windows, set PYTHONUTF8=1 before leanblueprint web (in PowerShell
$env:PYTHONUTF8 = 1): without it plasTeX writes some characters of the pages, the
proof arrows among them, through the system code page, and the browser shows them
garbled. The GitHub Actions build runs on Linux, where UTF-8 is the default.
GitHub Actions builds the project and the blueprint on every push to main, checks every
\lean tag against the compiled project, uploads the site and the PDF as a run artifact,
and deploys the blueprint to GitHub Pages; the site and the PDF are built afresh each time.
The dependency graph read off the Lean proofs comes from a separate extractor run on the
compiled project: its pages and data are committed in blueprint/graph/ and copied into
the site.
The Lean proofs in this project were produced with AI assistance. What is checked by
hand is the structure of the development and the statements of all individual
definitions and results; the proofs themselves are guaranteed by the Lean kernel.
An exception is the Borsuk–Ulam development (GridSimplex.lean, Tucker.lean,
BorsukUlam.lean) which was autonomously produced by AI, and was not (yet) checked by
myself apart from the main theorem statement.
Apache 2.0, the same as Mathlib. See LICENSE.
- D. Krieg, E. Novak, M. Ullrich, How many continuous measurements are needed to learn a vector?, Proc. Amer. Math. Soc. (2026), published online, doi, arxiv. The upper bound.
- M. Ullrich, A Borsuk–Ulam theorem for adaptive continuous measurements, preprint, 2026, arxiv. The lower bound.
- K. Borsuk, Drei Sätze über die n-dimensionale euklidische Sphäre, Fund. Math. 20 (1933), 177–190, doi. The odd-map form of the antipodal theorem.
- A. W. Tucker, Some topological properties of disk and sphere, in: Proc. First Canadian Math. Congress (Montreal, 1945), University of Toronto Press, 1946, 285–309, link. Its combinatorial form, which the proof here runs on.
- J. Matoušek, Using the Borsuk-Ulam Theorem, Springer, Berlin, 2003, doi. The modern account of that lemma and of the method.
- H. Freudenthal, Simplizialzerlegungen von beschränkter Flachheit, Ann. of Math. (2) 43 (1942), no. 3, 580–582, doi. The triangulation of the cube that Tucker's lemma is stated on.
- H. W. Kuhn, Some combinatorial lemmas in topology, IBM J. Res. Develop. 4 (1960), no. 5, 518–524, doi. The same triangulation.
- M. A. Krasnosel'skiĭ, On the estimation of the number of critical points of functionals, Uspekhi Mat. Nauk 7 (1952), no. 2, 157–164, link. The genus whose covering form the number of split sets is.