Skip to content

Import statistical learning theory formalization - #400

Open
Vilin97 wants to merge 4 commits into
mainfrom
codex/import-statistical-learning-theory-2026-09-04
Open

Import statistical learning theory formalization#400
Vilin97 wants to merge 4 commits into
mainfrom
codex/import-statistical-learning-theory-2026-09-04

Conversation

@Vilin97

@Vilin97 Vilin97 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

Imports the endpoint closure of Yuanhe Zhang, Jason D. Lee, and Fanghui Liu's Apache-2.0 statistical-learning formalization at commit d0f506f0a695018265dccb33bcb05e2f5ca1c876, ported from Lean 4.32 to the pool's Lean 4.34 toolchain.

The retained development covers four source endpoints:

  • LeanPool.StatisticalLearningTheory.truncated_dudley_entropy_bound
  • LeanPool.StatisticalLearningTheory.RMT.two_sided_subgaussian_matrices_hdp_of_pos
  • LeanPool.StatisticalLearningTheory.SmallBallProbability.small_ball_prob
  • LeanPool.StatisticalLearningTheory.LeastSquares.l1LocalizedImage_coveringNumber_le

Together they preserve a truncated Dudley entropy bound, two-sided singular-value concentration for isotropic sub-Gaussian random matrices, a small-ball probability inequality, and a localized l1-design covering bound. The registry records mixed provenance because the source proofs and the Lean Pool port/optimization both contribute substantially.

Closure and dead-code elimination

  • Upstream has 65 SLT modules. Exact module dependency closure from the four endpoints first selected 18 modules (15,278 physical lines after the initial port/reuse pass).
  • Declaration-level source/kernel closure then removed dead commands to a fixed point and made six modules empty, leaving 12 implementation modules.
  • Final extraction contains 263 project declarations: all 252 public declarations are in the transitive kernel dependency closure of the four endpoints. Six private proof-decomposition helpers are also kernel-live.
  • The remaining five private helpers are tiny simp/rfl source-elaboration dependencies. Each was separately removed and rebuilt to verify that elaboration fails without it; they are intentionally private rather than public API.
  • The SVD and Gaussian-Poincare developments, along with the other omitted source branches, are outside this four-endpoint closure. They were excluded by scope, not lost to a failed port.
  • There are no set_option overrides. The two formerly oversized Dudley proofs and the Maurey proof were decomposed into ordinary live helpers; every proof is below 200 code lines and every file below 10,000.

Source/final size (comments included / non-comment code):

Scope Modules Physical lines Code lines
Upstream SLT/ 65 55,867 44,920
Canonical checkout, all Lean files 68 56,130 45,091
Final implementation 12 6,505 5,553

Relative to upstream SLT/, the final implementation removes 49,362 physical lines (88.4%) and 39,367 code lines (87.6%). The generated 21-line project card is separate from those implementation figures.

Lean Pool reuse

The source's 4,583-line Hanson-Wright file shares ancestry with LeanPool.HansonWright, but its later API is not wholesale type-compatible. I kernel-checked a 15-name compatibility surface, delegated exact matches to the pooled implementation, and let endpoint DCE discard four adapter declarations that were not needed. The final live adapter has 11 declarations in 111 physical / 69 code lines, saving 4,472 physical lines (97.6%) and 4,245 code lines (98.4%) versus the source file.

The scalar sub-Gaussian layer likewise delegates to LeanPool.HansonWright.Probability.Process.SubGaussian: 1,039 physical / 834 code source lines become a 60 physical / 32 code-line compatibility module.

Build cost

Both measurements used cached dependency artifacts and no pre-existing project artifacts; every project module was compiled.

Build Jobs Wall time Peak RSS
Exact upstream, Lean 4.32.0 8,720 80.23 s 6,926,120 KB
Final endpoint closure, Lean 4.34 3,227 21.44 s 3,737,284 KB

The endpoint closure reduces wall time by 73.3%, peak RSS by 46.0%, and the build graph by 63.0% in this comparison.

Verification

  • warning-free forced rebuild of all 12 project modules and the project aggregate
  • full LeanPool.lean aggregate import compilation against a complete base artifact set
  • runLinter on the aggregate and every project module
  • lint-style on the aggregate and every project module
  • mk_all --check
  • full repository quality check, including Lean axiom and option-backdoor audits (Quality checks passed.)
  • exact source-shaped compile checks for all four endpoint signatures
  • #print axioms for each endpoint: only propext, Classical.choice, and Quot.sound
  • exact compiled dependency extraction at the final fixed point
  • clean long-line, forbidden-token, diff, and scratch-file scans

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Greptile Summary

The PR imports an endpoint-focused statistical-learning-theory formalization and integrates its project module into the Lean Pool catalog and root import surface.

  • Adds covering-number, metric-entropy, Dudley-bound, random-matrix, small-ball, and least-squares modules.
  • Reuses the existing pooled Hanson–Wright and sub-Gaussian infrastructure through compatibility adapters.
  • Registers the project and exposes its four retained endpoint developments.

Important Files Changed

Filename Overview
LeanPool/StatisticalLearningTheory.lean Adds the project umbrella module and imports the four retained endpoint branches.
LeanPool/StatisticalLearningTheory/HansonWright.lean Defines a source-shaped compatibility layer that delegates the live tail-bound proof to the existing pooled Hanson–Wright theorem.
LeanPool/StatisticalLearningTheory/RMT/Basic.lean Adds the random-matrix infrastructure and two-sided sub-Gaussian singular-value concentration endpoint.
LeanPool/StatisticalLearningTheory/TDudley.lean Adds the truncated Dudley entropy-bound development.
LeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1CoveringBound.lean Adds the Maurey-method covering argument and localized l1-design covering endpoint.
LeanPool/StatisticalLearningTheory/SmallBallProb.lean Adds the small-ball probability inequality and supporting measure-theoretic development.
LeanPool/projects.yml Registers the imported statistical-learning-theory project and its retained results.

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment thread LeanPool/StatisticalLearningTheory/HansonWright.lean
Comment thread LeanPool/StatisticalLearningTheory/CoveringNumber.lean Outdated
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build wall time (changed modules): 68.49 s (= 1.14 min) — user 180.28 s, sys 16.47 s.

This build covers the changed modules and their dependency cones on top of the restored cache. The serial per-file sums below are useful for ranking slow files, not as a build budget.

Total heartbeats: 861 maxHeartbeats units across 13 files (6,654 added LOC).

Sum of lean --profile: 148159.4 ms (= 148.16 s). Import-excluded time: 127319.4 ms (= 127.32 s).

Count-heartbeats wall-clock total: 120.12 s. Repeated import cost inside lean --profile: 20840.0 ms (= 20.84 s).

Heartbeat values come from Mathlib's linter.countHeartbeats and are already in maxHeartbeats units. Per-file wall clocks are measured under parallel load and are noisier than heartbeats.

LOC counts added lines in the profiled Lean files from this PR diff.

File LOC Heartbeats (maxHB) Count wall (s) lean --profile (s) Without import (s) Import (s) Decls Errors
LeanPool/StatisticalLearningTheory/TDudley.lean 2,091 226 28.62 50.42 48.69 1.73 53 0
LeanPool/StatisticalLearningTheory/RMT/Basic.lean 2,009 149 37.45 59.95 58.25 1.70 40 0
LeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1CoveringBound.lean 939 140 9.55 12.25 10.59 1.66 28 0
LeanPool/StatisticalLearningTheory/CoveringNumber.lean 587 98 5.68 5.05 3.50 1.55 28 0
LeanPool/StatisticalLearningTheory/LeastSquares/Defs.lean 162 85 4.10 2.41 0.94 1.47 16 0
LeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1DesignMatrix.lean 134 40 4.44 2.36 0.79 1.57 8 0
LeanPool/StatisticalLearningTheory/HansonWright.lean 111 33 3.42 2.35 0.65 1.70 11 0
LeanPool/StatisticalLearningTheory/SmallBallProb.lean 245 28 5.75 3.56 1.92 1.64 5 0
LeanPool/StatisticalLearningTheory/MetricEntropy.lean 163 24 3.57 2.20 0.66 1.54 8 0
LeanPool/StatisticalLearningTheory/SubGaussian.lean 60 18 4.91 2.03 0.35 1.68 6 0
LeanPool/StatisticalLearningTheory/LeastSquares/LinearRegression/DesignMatrix.lean 80 16 4.60 1.85 0.41 1.44 4 0
LeanPool/StatisticalLearningTheory/LeastSquares/Localization.lean 52 4 4.10 1.80 0.35 1.45 1 0
LeanPool/StatisticalLearningTheory.lean 21 0 3.93 1.95 0.24 1.71 0 0
Total 6,654 861 120.12 148.16 127.32 20.84 208 0

Aggregate phase totals

Phase Time
typeclass inference 40227.0 ms (= 40.23 s)
interpretation 34644.0 ms (= 34.64 s)
import 20840.0 ms (= 20.84 s)
tactic execution 17990.2 ms (= 17.99 s)
blocked (unaccounted) 11301.3 ms (= 11.30 s)
simp 7372.2 ms (= 7.37 s)
norm_num 3994.4 ms (= 3.99 s)
type checking 3196.2 ms (= 3.20 s)
elaboration 2277.0 ms (= 2.28 s)
tacticAnalysis 1382.1 ms (= 1.38 s)
ring 1336.7 ms (= 1.34 s)
linting 938.0 ms (= 0.94 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.StatisticalLearningTheory.RMT.Basic 44.00 s
LeanPool.StatisticalLearningTheory.TDudley 37.00 s
LeanPool.StatisticalLearningTheory.LeastSquares.L1Regression.L1CoveringBound 16.00 s
LeanPool.StatisticalLearningTheory.CoveringNumber 12.00 s
LeanPool.StatisticalLearningTheory.SmallBallProb 10.00 s
LeanPool.StatisticalLearningTheory.LeastSquares.Defs 9.60 s
LeanPool.StatisticalLearningTheory.SubGaussian 8.30 s
LeanPool.StatisticalLearningTheory.HansonWright 4.60 s
LeanPool.StatisticalLearningTheory.LeastSquares.Localization 3.60 s
LeanPool.StatisticalLearningTheory.MetricEntropy 3.30 s
LeanPool.StatisticalLearningTheory.LeastSquares.LinearRegression.DesignMatrix 2.90 s
LeanPool.StatisticalLearningTheory.LeastSquares.L1Regression.L1DesignMatrix 2.60 s
Per-file `lean --profile` output

LeanPool/StatisticalLearningTheory.lean

import took 1.71s
cumulative profiling times:
	elaboration 0.19ms
	import 1.71s
	initialization 29.4ms
	interpretation 204ms
	linting 0.316ms
	module linting 0.00101ms
	overlappingInstancesLinter 0.302ms
	parsing 0.0313ms
	tacticAnalysis 1.08ms
real 2.63
user 1.45
sys 1.18

LeanPool/StatisticalLearningTheory/CoveringNumber.lean

import took 1.55s
cumulative profiling times:
	attribute application 0.389ms
	compilation (IR) 0.0963ms
	compilation (LCNF base) 2.22ms
	compilation (LCNF impure) 0.455ms
	compilation (LCNF mono) 0.994ms
	congr simp thm 7.63ms
	elaboration 145ms
	fix level params 4.06ms
	import 1.55s
	initialization 39ms
	instantiate metavars 6.41ms
	interpretation 852ms
	let-to-have transformation 0.53ms
	linting 68.6ms
	module linting 0.00164ms
	norm_num 82.6ms
	overlappingInstancesLinter 16.8ms
	parsing 41.9ms
	process pre-definitions 24ms
	ring 40.7ms
	share common exprs 17.8ms
	simp 145ms
	tactic execution 503ms
	tacticAnalysis 104ms
	type checking 208ms
	typeclass inference 1.19s
real 3.57
user 4.49
sys 1.15

LeanPool/StatisticalLearningTheory/HansonWright.lean

import took 1.7s
cumulative profiling times:
	attribute application 0.0891ms
	blocked (unaccounted) 1.3ms
	compilation (IR) 0.177ms
	compilation (LCNF base) 2.93ms
	compilation (LCNF impure) 1.05ms
	compilation (LCNF mono) 1.8ms
	congr simp thm 1.59ms
	elaboration 59ms
	fix level params 0.23ms
	import 1.7s
	initialization 29.5ms
	instantiate metavars 0.265ms
	interpretation 297ms
	let-to-have transformation 0.13ms
	linting 8.09ms
	module linting 0.00141ms
	overlappingInstancesLinter 5.84ms
	parsing 7.12ms
	process pre-definitions 5.24ms
	share common exprs 0.9ms
	simp 16ms
	tactic execution 18.2ms
	tacticAnalysis 20.2ms
	type checking 35.9ms
	typeclass inference 140ms
real 2.84
user 1.81
sys 1.20

LeanPool/StatisticalLearningTheory/LeastSquares/Defs.lean

import took 1.47s
cumulative profiling times:
	attribute application 0.991ms
	compilation (IR) 0.119ms
	compilation (LCNF base) 1.27ms
	compilation (LCNF impure) 0.641ms
	compilation (LCNF mono) 1.02ms
	congr simp thm 1.7ms
	elaboration 40.6ms
	fix level params 0.374ms
	import 1.47s
	initialization 33.7ms
	instantiate metavars 0.68ms
	interpretation 287ms
	let-to-have transformation 0.0961ms
	linting 11.4ms
	module linting 0.00133ms
	norm_num 0.216ms
	overlappingInstancesLinter 3.26ms
	parsing 11.2ms
	process pre-definitions 6.21ms
	ring 3.9ms
	share common exprs 2.49ms
	simp 61.7ms
	tactic execution 148ms
	tacticAnalysis 26ms
	type checking 24.1ms
	typeclass inference 269ms
real 2.71
user 1.99
sys 1.04

LeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1CoveringBound.lean

import took 1.66s
typeclass inference of Nonempty took 106ms
typeclass inference of Nonempty took 104ms
typeclass inference of Nonempty took 109ms
typeclass inference of Nonempty took 107ms
typeclass inference of Nonempty took 109ms
typeclass inference of Nonempty took 108ms
tactic execution of Mathlib.Tactic.nlinarith took 481ms
tactic execution of Mathlib.Tactic.nlinarith took 142ms
tactic execution of Mathlib.Tactic.nlinarith took 190ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 210ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 134ms
cumulative profiling times:
	attribute application 1.48ms
	compilation (IR) 0.0336ms
	compilation (LCNF base) 0.558ms
	compilation (LCNF impure) 0.177ms
	compilation (LCNF mono) 0.255ms
	congr simp thm 24.7ms
	elaboration 217ms
	fix level params 4.26ms
	import 1.66s
	initialization 29.5ms
	instantiate metavars 12ms
	interpretation 1.8s
	let-to-have transformation 0.515ms
	linting 121ms
	module linting 0.00161ms
	norm_num 84ms
	overlappingInstancesLinter 13ms
	parsing 73.6ms
	process pre-definitions 50ms
	ring 119ms
	share common exprs 49.8ms
	simp 727ms
	tactic execution 2.32s
	tacticAnalysis 181ms
	type checking 309ms
	typeclass inference 4.45s
real 6.27
user 11.74
sys 1.17

LeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1DesignMatrix.lean

import took 1.57s
cumulative profiling times:
	attribute application 0.528ms
	congr simp thm 1.37ms
	elaboration 42ms
	fix level params 0.378ms
	import 1.57s
	initialization 29.1ms
	instantiate metavars 0.479ms
	interpretation 316ms
	let-to-have transformation 0.124ms
	linting 7.67ms
	module linting 0.00131ms
	norm_num 0.167ms
	overlappingInstancesLinter 2.72ms
	parsing 7.36ms
	process pre-definitions 3.32ms
	ring 3.88ms
	share common exprs 2.36ms
	simp 65.3ms
	tactic execution 81.9ms
	tacticAnalysis 20.6ms
	type checking 29.2ms
	typeclass inference 171ms
real 2.63
user 1.91
sys 1.08

LeanPool/StatisticalLearningTheory/LeastSquares/LinearRegression/DesignMatrix.lean

import took 1.44s
cumulative profiling times:
	attribute application 0.494ms
	congr simp thm 0.502ms
	elaboration 19ms
	fix level params 0.143ms
	import 1.44s
	initialization 29.1ms
	instantiate metavars 0.173ms
	interpretation 219ms
	let-to-have transformation 0.0718ms
	linting 4.15ms
	module linting 0.00161ms
	overlappingInstancesLinter 2.15ms
	parsing 3.62ms
	process pre-definitions 1.52ms
	share common exprs 0.95ms
	simp 4.03ms
	tactic execution 39.2ms
	tacticAnalysis 13.8ms
	type checking 15ms
	typeclass inference 52.6ms
real 2.37
user 1.46
sys 1.02

LeanPool/StatisticalLearningTheory/LeastSquares/Localization.lean

import took 1.45s
cumulative profiling times:
	attribute application 0.013ms
	congr simp thm 0.598ms
	elaboration 6.1ms
	fix level params 0.106ms
	import 1.45s
	initialization 28.6ms
	instantiate metavars 0.169ms
	interpretation 212ms
	let-to-have transformation 0.0197ms
	linting 3.23ms
	module linting 0.0015ms
	norm_num 0.605ms
	overlappingInstancesLinter 1.49ms
	parsing 1.95ms
	process pre-definitions 0.882ms
	ring 6.21ms
	share common exprs 1.29ms
	simp 7.6ms
	tactic execution 19.4ms
	tacticAnalysis 8.12ms
	type checking 6.47ms
	typeclass inference 40.5ms
real 2.39
user 1.40
sys 1.03

LeanPool/StatisticalLearningTheory/MetricEntropy.lean

import took 1.54s
cumulative profiling times:
	attribute application 0.0791ms
	compilation (IR) 0.0548ms
	compilation (LCNF base) 0.548ms
	compilation (LCNF impure) 0.325ms
	compilation (LCNF mono) 0.529ms
	congr simp thm 1.2ms
	elaboration 30.7ms
	fix level params 0.389ms
	import 1.54s
	initialization 28.7ms
	instantiate metavars 0.984ms
	interpretation 314ms
	let-to-have transformation 0.0699ms
	linting 9.58ms
	module linting 0.00164ms
	norm_num 0.554ms
	overlappingInstancesLinter 5.05ms
	parsing 7.22ms
	process pre-definitions 2.84ms
	ring 3.12ms
	share common exprs 1.57ms
	simp 29.6ms
	tactic execution 67.5ms
	tacticAnalysis 21.4ms
	type checking 35.5ms
	typeclass inference 100ms
real 2.62
user 1.77
sys 1.07

LeanPool/StatisticalLearningTheory/RMT/Basic.lean

import took 1.7s
tactic execution of Lean.Parser.Tactic.simpa took 109ms
type checking took 112ms
tactic execution of Lean.Parser.Tactic.change took 414ms
simp took 157ms
tactic execution of Lean.Parser.Tactic.refine took 127ms
interpretation of Lean.Elab.Tactic._aux_Mathlib_Tactic_Widget_Calc___elabRules_Lean_calcTactic_1._boxed took 132ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 560ms
tactic execution of Mathlib.Tactic.nlinarith took 506ms
tactic execution of Mathlib.Tactic.nlinarith took 707ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 509ms
tactic execution of Mathlib.Tactic.nlinarith took 694ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 610ms
tactic execution of Mathlib.Tactic.nlinarith took 851ms
simp took 100ms
simp took 145ms
interpretation of Mathlib.Meta.FunProp.funPropTac._boxed took 112ms
tactic execution of Lean.Parser.Tactic.rewriteSeq took 100ms
tactic execution of Lean.Parser.Tactic.rewriteSeq took 108ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 130ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 149ms
simp took 111ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 227ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 234ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 264ms
tactic execution of Mathlib.Tactic.nlinarith took 506ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 511ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 287ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 370ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 398ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 1.13s
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 1.43s
tactic execution of Mathlib.Tactic.nlinarith took 1.06s
simp took 110ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 158ms
simp took 120ms
cumulative profiling times:
	attribute application 1.36ms
	blocked (unaccounted) 11.3s
	compilation (IR) 0.143ms
	compilation (LCNF base) 1.4ms
	compilation (LCNF impure) 0.681ms
	compilation (LCNF mono) 1.11ms
	congr simp thm 51ms
	dsimp 90.2ms
	elaboration 918ms
	fix level params 13.5ms
	import 1.7s
	initialization 32.1ms
	instantiate metavars 25.8ms
	interpretation 11.3s
	let-to-have transformation 2.92ms
	linting 263ms
	module linting 0.00159ms
	norm_num 469ms
	overlappingInstancesLinter 36ms
	parsing 167ms
	process pre-definitions 156ms
	ring 353ms
	share common exprs 162ms
	simp 3.38s
	tactic execution 9.07s
	tacticAnalysis 415ms
	type checking 1.34s
	typeclass inference 18.7s
real 25.59
user 47.85
sys 1.37

LeanPool/StatisticalLearningTheory/SmallBallProb.lean

import took 1.64s
cumulative profiling times:
	aesop 43.1ms
	attribute application 0.058ms
	compilation (IR) 0.11ms
	compilation (LCNF base) 1.31ms
	compilation (LCNF impure) 0.566ms
	compilation (LCNF mono) 0.953ms
	congr simp thm 7.19ms
	dsimp 12.1ms
	elaboration 49.9ms
	fix level params 1.06ms
	import 1.64s
	initialization 35.6ms
	instantiate metavars 1.12ms
	interpretation 594ms
	let-to-have transformation 0.111ms
	linting 28.1ms
	module linting 0.00142ms
	norm_num 7.22ms
	overlappingInstancesLinter 4.41ms
	parsing 17ms
	process pre-definitions 13.2ms
	ring 18.9ms
	share common exprs 7.43ms
	simp 136ms
	tactic execution 333ms
	tacticAnalysis 45ms
	type checking 70.6ms
	typeclass inference 496ms
real 3.22
user 3.06
sys 1.11

LeanPool/StatisticalLearningTheory/SubGaussian.lean

import took 1.68s
cumulative profiling times:
	attribute application 0.101ms
	elaboration 22.5ms
	fix level params 0.106ms
	import 1.68s
	initialization 29.4ms
	instantiate metavars 0.0861ms
	interpretation 249ms
	let-to-have transformation 0.0527ms
	linting 3.86ms
	module linting 0.00133ms
	overlappingInstancesLinter 3.09ms
	parsing 3.58ms
	process pre-definitions 0.748ms
	share common exprs 0.284ms
	tacticAnalysis 11.9ms
	type checking 2.46ms
	typeclass inference 17.9ms
real 2.61
user 1.53
sys 1.15

LeanPool/StatisticalLearningTheory/TDudley.lean

import took 1.73s
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 162ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 146ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 148ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 145ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 172ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 757ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 303ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 157ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 162ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 150ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 173ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 1.26s
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 1.16s
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 835ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 102ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 120ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 155ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 162ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 191ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 1.11s
interpretation of Mathlib.Tactic.RingNF._aux_Mathlib_Tactic_Ring_RingNF___elabRules_Mathlib_Tactic_RingNF_ringNF_1._boxed took 132ms
typeclass inference of Nonempty took 103ms
typeclass inference of Nonempty took 103ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 205ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 323ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 480ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 158ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_NormNum_Core___elabRules_Mathlib_Tactic_normNum_1._boxed took 103ms
typeclass inference of MulRightMono took 118ms
simp took 103ms
simp took 132ms
simp took 131ms
tactic execution of Lean.Parser.Tactic.rewriteSeq took 185ms
tactic execution of Lean.Parser.Tactic.rewriteSeq took 235ms
tactic execution of Lean.Parser.Tactic.rewriteSeq took 189ms
simp took 194ms
interpretation of Mathlib.Tactic._aux_Mathlib_Tactic_Linarith_Frontend___elabRules_Mathlib_Tactic_nlinarith_1._boxed took 672ms
cumulative profiling times:
	aesop 42.8ms
	attribute application 0.698ms
	compilation (IR) 0.153ms
	compilation (LCNF base) 1.52ms
	compilation (LCNF impure) 0.807ms
	compilation (LCNF mono) 1.08ms
	congr simp thm 139ms
	dsimp 19.2ms
	elaboration 727ms
	fix level params 21.7ms
	import 1.73s
	initialization 36.6ms
	instantiate metavars 60.7ms
	interpretation 18s
	let-to-have transformation 1.49ms
	linting 409ms
	module linting 0.00151ms
	norm_num 3.35s
	overlappingInstancesLinter 34.9ms
	parsing 175ms
	process pre-definitions 190ms
	ring 788ms
	share common exprs 267ms
	simp 2.8s
	tactic execution 5.39s
	tacticAnalysis 514ms
	type checking 1.12s
	typeclass inference 14.6s
real 19.84
user 49.65
sys 1.38

Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🤖 LLM review (gpt-5.6-sol, 5 rubrics)

Reviewed head: 2da1b7fc7aa9a9ef9428c3025d4f6d87dc8b3dc9

Verdict: 🛑 request_changes — computed from the rubric verdicts below, not chosen by a model.

Rubric Verdict Bottom line
Faithfulness 🛑 block The Dudley headline uses a totalized supremum that collapses unbounded oscillations to zero, and the localized covering headline hides an additional empirical-metric normalization.
Novelty pass The searches ran for all four headlines and found no Mathlib or pooled declaration that already proves any of them.
Significance pass This is a substantial theory-building project with several recognizable graduate-level results in statistical learning and high-dimensional probability.
Sources pass The diff consistently credits the pinned upstream formalization and labels the high-dimensional-probability material as later development, but the exact contents of the arXiv paper and GitHub commit are not verifiable from the diff.
Code quality (advisory) 🤔 discuss The development carries substantial generated debt: a long proof duplicates an immediately preceding result, exact theorem and proof duplicates remain, and the compatibility and RMT APIs retain unused assumptions and fields.
Aspect Value
Proves the claim 🛑 mismatch
Assumed, not proved The Dudley diameter, sub-Gaussian increment, total-boundedness, nonemptiness, and integrability hypotheses; the RMT bundled measurable/independent/mean-zero/isotropic/finite-scale row hypotheses; the small-ball measurability, independence, nonnegativity, and density hypotheses; and the covering bound's column normalization are all explicit and disclosed.
Matches cited source 🟡 unverifiable
Fit good_fit
Level graduate
Branch statistical learning theory and high-dimensional probability
Mode theory_building
Code quality 2 / 5

Statement check: The RMT and small-ball endpoints match their informals, but truncated_dudley_entropy_bound bounds totalized ℝ-valued sSups and l1LocalizedImage_coveringNumber_le covers Xθ/√n in a metric that divides distances by another √n.

The contribution develops covering and metric entropy machinery through a truncated Dudley bound, Maurey covering bounds, a small-ball inequality, and two-sided singular-value concentration for isotropic sub-Gaussian random matrices.

Faithfulness findings (2)

  • overclaimed-headlineLeanPool/StatisticalLearningTheory/TDudley.lean:55
    globalOsc and localOsc are real-valued totalized suprema, with no pathwise BddAbove hypothesis. An unbounded increment set therefore produces value zero under Real.sSup_of_not_bddAbove; the proof explicitly handles this branch. Consequently, integrability of these functions does not assert that the mathematical oscillations are finite or integrable. Add pathwise boundedness of the global increment set, or revise the card to state that it concerns these zero-on-unbounded totalized definitions.
    Evidence: The definitions are def globalOsc (X : α → ℝ) (T : Set α) : ℝ := sSup {X x - X y | (x ∈ T) (y ∈ T)} and def localOsc (X : α → ℝ) (T : Set α) (δ : ℝ) : ℝ := sSup {X x - X y | (x ∈ T) (y ∈ T) (_ : dist x y ≤ δ)}. The headline assumes only (h_integrable_global : Integrable (fun ω => globalOsc (X ω) T) P) and (h_integrable_local : Integrable (fun ω => localOsc (X ω) T δ) P). Its supporting proof contains rw [Real.sSup_of_not_bddAbove] at h_contra for the unbounded case.
  • surrogate-objectLeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1CoveringBound.lean:878
    The image already divides by √n, but its ambient EmpiricalSpace distance applies the empirical norm and divides Euclidean distances by another √n. For positive n, the effective distance between represented predictors is the Euclidean norm of X(θ−θ′) divided by n, not the Euclidean distance on the card's normalized image Xθ/√n. This is a contracted covering problem. Either remove the extra scaling from the represented image while retaining the empirical metric, or disclose the ambient empirical metric and the resulting second normalization in the informal.
    Evidence: The metric is defined by noncomputable def empiricalNorm (n : ℕ) (f : Fin n → ℝ) : ℝ := Real.sqrt ((n : ℝ)⁻¹ * ∑ k : Fin n, f k ^ 2) and noncomputable instance instDist (n : ℕ) : Dist (EmpiricalSpace n) where dist a b := empiricalNorm n (a - b). The set is defined with v = fun i => (1 / Real.sqrt n) * @inner ℝ _ _ θ (x i), and the theorem concludes coveringNumber ε (l1LocalizedImage x R δ) ≤ (2 * d + 1) ^ ⌈R ^ 2 / ε ^ 2⌉₊.

Code quality findings (7)

  • agent-slopLeanPool/StatisticalLearningTheory/LeastSquares/L1Regression/L1CoveringBound.lean:690
    exists_maureyAvg_close rebuilds a finite-minimum argument and special-cases zero parameters after maurey_exists_good_sample has already established the required squared-distance estimate for every positive k. Obtain that sample directly, bound R * l1norm θ / k by R ^ 2 / k and then by ε ^ 2, and conclude from nonnegativity. The current detour also leaves hk_pos_real and hvar_bound unused.
    Evidence: maurey_exists_good_sample concludes dist (maureyAvg x R k f) (fun i => (1 / Real.sqrt n) * @inner ℝ _ _ θ (x i)) ^ 2 ≤ R * l1norm θ / k. The next proof nevertheless introduces let distSq : α → ℝ := fun f => dist (maureyAvg x R k f) target ^ 2, obtain ⟨f₀, hf₀_min⟩ := Finite.exists_min distSq, and by_cases hk1 : k = 1, before later calling obtain ⟨f_good, hf_good⟩ := maurey_exists_good_sample x θ hR hθ hcol hn k hkpos. It also declares have hk_pos_real : (0 : ℝ) < k := Nat.cast_pos.mpr hkpos and have hvar_bound : R * l1norm θ ≤ R ^ 2 := by without using either binding.
  • duplicate-definitionLeanPool/StatisticalLearningTheory/TDudley.lean:1250
    dudley_sum_bound_tight restates dudley_sum_bound with the same arguments and conclusion and only forwards to it. Remove the alias and have dudley_step_sum_le_entropy call dudley_sum_bound directly.
    Evidence: lemma dudley_sum_bound_tight {f : ℝ → ℝ} {D : ℝ} (hD : 0 < D) (hf_antitone : AntitoneOn f (Set.Icc 0 D)) (L : ℕ) (hL : 1 ≤ L) : ∑ k ∈ Finset.range (L - 1), 4 * (D * 2 ^ (-(k + 1 : ℝ))) * f (D * 2 ^ (-(k + 2 : ℝ))) ≤ 16 * ∫ x in Set.Icc (D * 2 ^ (-(L + 1 : ℝ))) (D * 2 ^ (-2 : ℝ)), f x := by convert dudley_sum_bound hD hf_antitone L hL using 1.
  • duplicate-definitionLeanPool/StatisticalLearningTheory/RMT/Basic.lean:900
    operatorNorm_one_pos_of_pos and one_le_operatorNorm_one_of_pos repeat the same witness, norm computation, operator application, and lower-bound proof. Prove one_le_operatorNorm_one_of_pos once and derive positivity from it.
    Evidence: Both declarations begin with the same body: unfold HansonWright.operatorNorm, let i : Fin n := ⟨0, hn⟩, let e : EuclideanSpace ℝ (Fin n) := EuclideanSpace.single i (1 : ℝ), the identical have he, have happly, and have hle. The first ends with exact lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1) hle, while the second ends with exact hle.
  • unused-structure-fieldLeanPool/StatisticalLearningTheory/RMT/Basic.lean:530
    The codomain half of MatrixBilinearNet has no consumer in the retained development: all net reductions use domainNet, and the sole endpoint path explicitly discards the codomain bound. Replace this rectangular two-net structure with the single centered sphere net actually used.
    Evidence: structure MatrixBilinearNet (m n : ℕ) (ε : ℝ) where contains codomainNet : Finset (EuclideanSpace ℝ (Fin m)) and codomain_isNet : IsENet codomainNet ε (euclideanUnitSphere m); CenteredMatrixBilinearNet adds codomain_subset_unitBall. There is only lemma MatrixBilinearNet.exists_domain_near, and the tail proof uses obtain ⟨N, hN_domain, _hN_codomain⟩ := exists_quarter_centeredMatrixBilinearNet n n.
  • unused-hypothesisLeanPool/StatisticalLearningTheory/RMT/Basic.lean:1000
    The endpoint proof never selects the measurable or mean_zero fields of HasIndependentMeanZeroIsotropicSubGaussianRows; downstream arguments use only row independence, isotropy, and finite row ψ₂ bounds. Split or weaken this assumption structure so the theorem does not require unused data.
    Evidence: The structure declares measurable : ∀ i j, Measurable (A i j) and mean_zero : ∀ i (x : EuclideanSpace ℝ (Fin n)), ∫ ω, inner ℝ (randomMatrixRowVector A i ω) x ∂μ = 0. Subsequent projections shown in the diff are hA.independent_rows.comp, hA.isotropic i x, and hA.finite_row_psi2; there is no use of hA.measurable or hA.mean_zero.
  • unused-hypothesisLeanPool/StatisticalLearningTheory/HansonWright.lean:84
    The compatibility theorem asks for four constant conditions that its proof discards. Expose the leaner adapter theorem matching the pooled Hanson–Wright result; otherwise downstream constant lemmas exist only to satisfy ceremonial arguments.
    Evidence: hanson_wright_inequality takes (_hC : 0 < C), (_hC_domain : 4 * exp 1 ≤ C), (_hC_diag_quad : 8 * exp 1 ^ 3 ≤ C), and (_hC_offdiag_domain : 16 * exp 1 ≤ C ^ 2), but the delegated call is _root_.LeanPool.HansonWright.hanson_wright_inequality hK hC_offdiag_quad hF hOp h_indep hX_subG ht.
  • unused-hypothesisLeanPool/StatisticalLearningTheory/CoveringNumber.lean:264
    Nonnegativity of eps is threaded through the half-ball disjointness and volume lemmas but never used. Remove these suppressed hypotheses and the corresponding arguments at their callers.
    Evidence: closedBall_half_disjoint takes (_heps : 0 ≤ eps) but proves the result solely from hsep; volume_disjoint_union_closedBalls likewise takes {eps : ℝ} (_heps : 0 ≤ eps) and its body is only have hmeas ...; exact measure_biUnion_finset hpwd hmeas. packing_halfBalls_pairwiseDisjoint uses its heps only as closedBall_half_disjoint heps hsep.

Tokens: 609,757 in / 33,666 out across 5 rubric calls · Tier: flex · Effort: xhigh · Cost: $2.0294
Each rubric is an independent review against .github/review-rubrics/ on top of .github/REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
request_changes is an ask, not a close: of the reviewer's past request_changes verdicts, 39% were merged after a human looked. Read the findings before acting on the verdict.

# Conflicts:
#	LeanPool/projects.yml
@Vilin97

Vilin97 commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Changes requested by automated review

Reviewed exact head 5c7a49a1fe0eecd10800225da1563f66529bf5e3. Two faithfulness blockers from the exact project remain. TDudley.globalOsc and localOsc are totalized Real.sSup values with no BddAbove hypothesis, so an unbounded increment set takes the Real.sSup_of_not_bddAbove zero branch; the headline therefore does not state the usual Dudley oscillation bound unless boundedness is added or the card explicitly scopes the totalized surrogate. In L1CoveringBound, the represented image already uses Xθ / √n while EmpiricalSpace divides its norm by another √n, so the theorem covers a twice-normalized metric, not the card's stated normalized image; remove one scaling or correct the informal and declaration names. The project CI is green, but these are semantic corrections required before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant