Comparator certificate
Latest verification result
Lean default kernel accepts the solution / Your solution is okay!
- Date
- 2026-09-26
- Commit
aa16b1e(branchmain)- Theorems checked
- 64 (all of
comparator/config.json) - Permitted axioms
propext,Quot.sound,Classical.choice- Toolchain
- Lean
v4.32.0, Mathlibv4.32.0, lean4exportv4.32.0, fake-landrun (macOS)
Last three lines of the output of ./script/comparator.sh:
Running Lean default kernel on solution. Lean default kernel accepts the solution Your solution is okay!
What Comparator certifies
Comparator takes a challenge
(theorem statements with the proofs replaced by sorry) and a solution
(the same statements with proofs), exports both environments with
lean4export and checks, for every theorem
listed in the configuration, that:
- Statement equality. The theorem's type in the solution is identical to its type in the challenge, and every constant occurring in the statement is identical in both environments (definitions cannot be silently changed to make the theorem easier).
- Permitted axioms. The proof depends on no axiom outside the permitted list
(
propext,Quot.sound,Classical.choice); in particular nosorryAxand no project-specific axiom. - Kernel replay. Lean's default kernel re-checks the exported solution independently
of the elaborator, so the certificate does not rely on tactics or on
lake buildalone.
Everything in the import closure of the challenge is the trusted vocabulary of the certificate.
comparator/Challenge.lean imports only the definition modules of the library
(LeanDeepgen.Setting.*, Profiles.Defs, Tradeoff.Defs,
Growth.Defs) and the example modules holding the definitions of the worked examples;
the general-purpose tools come from
lean-rademacher
(FoML.ToMathlib, FoML.ToFoML). The statements are the paper's theorems in their
Lean form, that is, with the corrections and generalizations described in the
README.
Configuration
comparator/config.json lists 64 theorems of LeanDeepgen.Challenge
(challenge module Challenge, solution module Solution; both are Lake libraries
with srcDir = "comparator") and the three permitted axioms. Each challenge statement is copied
verbatim (binders, implicitness, hypothesis order, universe levels) from the library theorem; the
open lines of each section reproduce the context of the source module so that both files
elaborate to identical kernel terms. The one exception is thm_dudley_subgaussian, whose
auxiliary definitions live in a theorem module and are therefore unfolded inline in the challenge.
Not included: the cited theorems thm:guivarch-bass, cor:nilpotent-entropy,
thm:breuillard-large-balls (not formalized; P2 takes their conclusion as a hypothesis), the
Φ∞ part of lem:cot-output, and the integral identity of
lem:log-split (used inside the proofs of prop:profiles (ii)/(iv)).
Note (2026-09-26): thm:rad.decomp.ent.ent (both forms) and thm:caa
are a different case — they are formalized and remain in the challenge, but the manuscript
was pruned on 2026-09-26 and no longer prints the corresponding appendix sections (formerly App. E,
“A deterministic entropy alternative to thm:hidden-decomp”, and App. P,
“Compact-Domain Arzelà–Ascoli Principle for Self-Maps”, in the pre-2026-09-26
lettering — not to be confused with the current Appendix E, “The Sudakov-type
converse”, a different section under the reorganized lettering A–M introduced later the
same day). The Lean modules Bounds/EntropyDecomp, Bounds/EntropyDecompSample
and Growth/ArzelaAscoli are unchanged.
Note (2026-09-26, appendix reorganization): the manuscript's appendix was further
reorganized the same day into a fixed order and lettering A–M (see SUMMARY.md):
A conventions/basic facts, B literature, C bias–variance, D hidden–output, E the
Sudakov-type converse (thm:sudakov-type, cor:matching,
cor:sudakov-rates, prop:global_scalar_observable,
prop:linear-interpolation, cor:rkhs-readout), F growth mechanisms, G the
layerwise envelope, H variance profiles, I the four regimes and balancing depths, J
teacher–student/neural-operator/implementation examples (prop:implementation,
proof now in J.3), K deep ReLU networks, L chain-of-thought symbolic computation, M unrolled
iterative solvers and samplers. All Lean labels referenced in the table below are unchanged by
this reorganization; only their location within the appendix moved.
Mapping: paper label → challenge theorem → library declaration
| Paper label | LeanDeepgen.Challenge. | Library theorem (LeanDeepgen.) | Module |
|---|---|---|---|
thm:bv-general | thm_bv_general | bv_general | Bounds/BiasVariance |
thm:bv-general (gap) | thm_bv_general_gap | bv_general_gap | Bounds/BiasVariance |
thm:bv | thm_bv | bv | Bounds/BiasVariance |
thm:bv (gap) | thm_bv_gap | bv_gap | Bounds/BiasVariance |
thm:hidden-decomp (= thm:mixed-sg) | thm_hidden_decomp | hidden_decomp | Bounds/HiddenOutput |
thm:hidden-decomp (depth k) | thm_hidden_decomp_depth | hidden_decomp_depth | Bounds/HiddenOutput |
prop:hilbert-sg | prop_hilbert_sg | hilbert_sg | Bounds/HiddenOutput |
prop:finite-lipschitz-sg | prop_finite_lipschitz_sg | finite_lipschitz_sg | Bounds/HiddenOutput |
thm:sudakov-type (= thm:sudakov) | thm_sudakov_type | sudakov_type | Bounds/Sudakov |
cor:sudakov-rates (i) | cor_sudakov_rates | sudakov_rates_exp | Bounds/Sudakov |
cor:sudakov-rates (ii) | cor_sudakov_rates_poly | sudakov_rates_poly | Bounds/Sudakov |
cor:matching (i) | cor_matching | matching_exp | Bounds/Sudakov |
cor:matching (ii) | cor_matching_poly | matching_poly | Bounds/Sudakov |
thm:rad.decomp.ent.ent(not printed in the current manuscript; kept in the library — formerly App. E of the ICLR draft) | thm_rad_decomp_ent_ent | rad_decomp_ent_ent | Bounds/EntropyDecomp |
thm:rad.decomp.ent.ent (sample)(not printed in the current manuscript; kept in the library — formerly App. E of the ICLR draft) | thm_rad_decomp_ent_ent_sample | rad_decomp_ent_ent_sample | Bounds/EntropyDecompSample |
thm:caa(not printed in the current manuscript; kept in the library — formerly App. P of the ICLR draft) | thm_caa | totallyBounded_unifMaps_iff_equicontinuous | Growth/ArzelaAscoli |
cond:p1 (1) | cond_p1 | cond_p1_of_totallyBounded | Growth/Saturation |
cond:p1 (2a) | cond_p1_2a | cond_p1_of_equicontinuous | Growth/Saturation |
cond:p1 (2b) | cond_p1_2b | cond_p1_of_uniformLipschitz | Growth/Saturation |
cond:p1 (2c) | cond_p1_2c | cond_p1_of_nonexpanding | Growth/Saturation |
cond:p1-ucont | cond_p1_ucont | cond_p1_ucont | Growth/Saturation |
cond:p2-nilp | cond_p2_nilp | cond_p2_nilp | Growth/Polynomial |
cond:e1-free-iso | cond_e1_free_iso | cond_e1_free_iso | Growth/Exponential |
cond:e1p-theoremC | cond_e1p | cond_e1p_theoremC | Growth/Exponential |
cond:e2-pingpong | cond_e2_pingpong | cond_e2_pingpong | Growth/Exponential |
cond:e3 | cond_e3 | cond_e3 | Growth/MemoryExpansion |
cor:superexp | cor_superexp | cor_superexp | Growth/MemoryExpansion |
cor:doubleexp | cor_doubleexp | cor_doubleexp | Growth/MemoryExpansion |
lem:log-split (inequality) | lem_log_split | log_one_add_div_le | Profiles/LogSplit |
prop:profiles (i) | prop_profiles_i | profile_saturation | Profiles/Profiles |
prop:profiles (ii) | prop_profiles_ii | profile_poly_bounded | Profiles/Profiles |
prop:profiles (iii) | prop_profiles_iii | profile_exp_bounded | Profiles/Profiles |
prop:profiles (iv) | prop_profiles_iv | profile_poly_linear | Profiles/Profiles |
prop:profiles-finite | prop_profiles_finite | profile_finite | Profiles/Profiles |
tab:tradeoff PP | thm_tradeoff_pp | Tradeoff.tradeoff_PP | Tradeoff/Regimes |
tab:tradeoff EP | thm_tradeoff_ep | Tradeoff.tradeoff_EP | Tradeoff/Regimes |
tab:tradeoff EL | thm_tradeoff_el | Tradeoff.tradeoff_EL | Tradeoff/Regimes |
tab:tradeoff PL | thm_tradeoff_pl | Tradeoff.tradeoff_PL | Tradeoff/Regimes |
prop:implementation (a) | prop_implementation_a | prop_implementation_a | Examples/Implementation |
prop:implementation (b) | prop_implementation_b | prop_implementation_b | Examples/Implementation |
prop:implementation (c) | prop_implementation_c | prop_implementation_c | Examples/Implementation |
prop:global_scalar_observable | prop_global_scalar_observable | global_scalar_observable | Examples/Readout |
prop:linear-interpolation | prop_linear_interpolation | linear_interpolation | Examples/Readout |
cor:rkhs-readout | cor_rkhs_readout | rkhs_readout | Examples/Readout |
lem:cot-append-growth | lem_cot_append_growth | cot_append_growth | Examples/ChainOfThought |
lem:cot-branch-growth | lem_cot_branch_growth | cot_branch_growth | Examples/ChainOfThought |
lem:cot-output (window Φ_L) | lem_cot_output | lipschitzWith_windowFeature | Examples/ChainOfThought |
prop:cot-append | prop_cot_append | prop_cot_append | Examples/ChainOfThought |
lem:fp-contraction | lem_fp_contraction | fp_contraction | Examples/ODE |
lem:ode-saturation | lem_ode_saturation | ode_saturation | Examples/ODE |
lem:ode-euler-error | lem_ode_euler_error | euler_global_error | Examples/ODE |
prop:ode-fixedpoint | prop_ode_fixedpoint | prop_ode_fixedpoint | Examples/ODE |
prop:ode-horizon | prop_ode_horizon | prop_ode_horizon | Examples/ODE |
prop:envelope (= prop:envelope-restated) | prop_envelope | prop_envelope | Growth/Envelope |
cor:envelope-profiles (a), (b) | cor_envelope_profiles | cor_envelope_profiles | Growth/Envelope |
lem:reachable-radius | lem_reachable_radius | lem_reachable_radius | Growth/Envelope |
lem:ode-scheme-entropy (distance, covering) | lem_ode_scheme_entropy | lem_ode_scheme_entropy | Examples/ODE |
lem:ode-scheme-entropy-profile | equalSchemeClass_profile | equalSchemeClass_profile | Examples/ODE |
lem:cot-branch-sample | lem_cot_branch_sample | lem_cot_branch_sample | Examples/ChainOfThought |
lem:relu-layer-covering | lem_relu_layer_covering | lem_relu_layer_covering | Examples/ReLU |
prop:relu-regimes (i)–(iii), upper bounds | prop_relu_regimes | prop_relu_regimes | Examples/ReLU |
prop:relu-regimes (iii), lower bound (E2) | prop_relu_regimes_iii_lower | prop_relu_regimes_iii_lower | Examples/ReLU |
thm:bernoulli-sudakov (bonus) | thm_bernoulli_sudakov | FoML.ToFoML.bernoulli_sudakov (lean-rademacher) | FoML/ToFoML/BernoulliSudakov |
thm:dudley-subgaussian (bonus, inlined) | thm_dudley_subgaussian | FoML.ToFoML.dudley_subgaussian_finite_space (lean-rademacher) | FoML/ToFoML/DudleySubGaussian |
How to reproduce
git clone https://github.com/shosonoda/lean-deepgen.git cd lean-deepgen lake exe cache get && lake build # once: Comparator and lean4export (for this project's Lean version) in ../comparator-tools/ mkdir -p ../comparator-tools && cd ../comparator-tools git clone https://github.com/leanprover/comparator.git && (cd comparator && lake build comparator) git clone --branch v4.32.0 https://github.com/leanprover/lean4export.git lean4export-v4.32.0 && (cd lean4export-v4.32.0 && lake build) cd - ./script/comparator.sh # about a minute; ends with "Your solution is okay!"
The script builds Challenge and Solution, exports them and runs the checker on
comparator/config.json. On Linux it uses landrun for sandboxing when available and
Comparator's fake-landrun shim otherwise (always on macOS). The tool locations can be overridden
with COMPARATOR_TOOLS, COMPARATOR_BIN, COMPARATOR_LEAN4EXPORT and
COMPARATOR_LANDRUN.