This repository contains formalizations for some of the basic Lebesgue space theory of spherical maximal functions with an emphasis on restricted dilation sets.
Completed:
- Stein's spherical maximal theorem:
Spherical.eLpNorm_sphericalMaximal_le - Lacunary spherical maximal theorem:
Spherical.RestrictedDilations.eLpNorm_lacunarySphericalMaximal_le -
$L^p \to L^p$ bounds for restricted dilation sets, for$d \ge 3$ : Seeger-Wainger-Wright '08:Spherical.RestrictedDilations.eLpNorm_restrictedSphericalMaximal_le - Power weights, Thm. 1.1 of Fraccaroli-Roos-Seeger '26, for
$d \ge 3$ :Spherical.PowerWeights.closure_typeSet_eq - Thm. 2 of arXiv:1909.05389 (Sharpness examples for
$L^p$ improving)
ToDo:
- Bourgain's theorem
$d = 2$ - Finish Thm. 1 of arXiv:1909.05389
- Typeset characterization: Thm. 1.2 of arXiv:2004.00984
To build and verify the formalization locally follow these steps:
-
Install Lean 4 following instructions here.
-
Clone this repository using
git clone https://github.com/roos-j/lean-spherical
-
Open the repository folder in VSCode, open a terminal and run
lake exe cache get!
This is not strictly necessary, but will significantly speed up the build process by fetching pre-built dependencies such as Mathlib.
- Open the file
LeanSpherical.leanin VSCode. To verify a theorem move your cursor to the corresponding line, e.g. for Stein's spherical maximal theorem
#print axioms eLpNorm_sphericalMaximal_le
After some time, the Lean InfoView window should then display the message
'Spherical.eLpNorm_sphericalMaximal_le' depends on axioms: [propext, Classical.choice, Quot.sound]
This means that Lean has successfully certified correctness of the theorem assuming only the standard set of axioms.
Alternatively, run
lake build
from the terminal in VSCode.
Almost all of the ~180k lines of code in this project were machine-generated by Codex with minimal supervision.
This project maintains strict separation of machine-generated code from human-generated code. All machine-generated code is located in the Codex subfolder and lives in the Codex namespace in Lean.
Only the definitions necessary to state the main theorems and the statements of the main theorems were human generated.
These are located in Definitions.lean.
and Theorems.lean, respectively.
During the formalization of Stein's theorem, Codex independently formalized several prerequisites from harmonic analysis that are not currently in Mathlib (though they are contained in other existing projects, such as the Carleson project). These include Marcinkiewicz interpolation, weak (1,1) boundedness of the Hardy-Littlewood maximal function, Fourier decay of the surface measure of the sphere, and other basic things.
The bulk of the formalization of the 18 pages of arXiv:2602.17613 was done by 5.6 Terra Ultra during a single ~25h session that started with a simple prompt.
A major drawback is that the generated code contains a lot of bloat in the form of unnecessary abstractions, wrappers and redundancies. It is also not written at an appropriate level of generality. Needless to say, almost all of it is extremely far from adequate for Mathlib.
Lean certifies correctness1 of the human-written theorems, so the machine-generated proofs never have to be trusted or reviewed by a human2.
Footnotes
-
Assuming soundness of the Lean 4 kernel, a non-trivial assumption. ↩
-
Within reason. The code still had to be reviewed sufficiently to ensure that Codex followed instructions and did not attempt to act adverserially, for example by writing adverserial meta programs or otherwise trying to compromise the user's system. The degree to which machine-generated code has to be looked at can be further minimized by relying on a correctness judge like Lean Comparator. ↩