Repository navigation
refactor(Foundations): consolidate Section B general-mathematics helpers (#939) - #1627
Conversation
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — APPROVE at feb7599ccae32a53f74d0c5dd768657b719e61b6 (independent agent review, not human approval).
Read the complete 14-file diff, moved statements/proofs and affected callers. The generalizations are sound: Boolean-choice product expansion needs only a commutative ring; matrix cancellation retains a unit determinant and invertible scalar and permits rectangular right factors; the new StateT fold rule preserves both value and state without requiring monad laws. The Except specialization preserves early errors. The natural exponential bound recovers the hierarchy's original real-division inequality after restricting to positive inputs; its public hierarchy statement is unchanged. WPP now obtains the same expansion without importing SharpP.Products. Removed names have updated callers and no aliases; source credit is retained.
The checked examples include sum(Fin 4) = 6 and cancellation at scalar 3 with the identity matrix. No computational definitions, model/resource conventions, selected abstracts or rendering change. git diff --check passes. The author reports all six local gates passed; hosted Lean CI was running when inspected, and title checks passed. Source review only; no local Lean build.
|
Review by reviewer agent Head: What I checked
Nits (non-blocking)
Limits: I did not build locally because disk space is limited. I relied on hosted CI run 40883114456 ( |
Part of #939 (Section B: general mathematics in domain modules).
Moves six groups of general-mathematics lemmas identified in the #931–#938 audits from domain modules into
Complexity/Foundations/, generalizes their types where appropriate, updates all callers without deprecated aliases, and adds regression tests inComplexityTests/Consolidation.lean:Nat.eventually_add_one_pow_mul_lt_powinComplexity/Foundations/Data/Nat/Asymptotics.lean(∀ᶠ n : ℕ in atTop, (n + 1) ^ k * n < b ^ nfor1 < b), replacing the real-division helper inComplexity/Computability/Circuit/Boolean/Hierarchy.lean(SIZE_pow_ssubset, flagged in refactor(Circuit/Boolean): make 74 API and general declarations public again (#926) #931).Real.exists_one_le_and_mul_pow_le_powinComplexity/Foundations/Data/Nat/Choose/Real.lean(∃ α : ℕ, 1 ≤ α ∧ C * (α : ℝ) ^ d ≤ r ^ αfor1 < r), moved fromComplexity/Logics/Propositional/ClauseSet/Sparsification.lean(flagged in refactor(Logics,Algorithms,WordRAM): make 42 API and general declarations public again (#926) #937).StateT.foldlM_run(for any[Monad m]) andStateT.foldlM_run_exceptinComplexity/Foundations/Control/Monad/IsMonadHom/StateT.lean, moved fromComplexity/Computability/Complexity/Classes/IP/CoinFixing.lean(flagged in refactor(Classes,PCP,TreeEval,Kolmogorov): make 57 API and general declarations public again (#926) #936).Cslib.prod_sub_mul_eq_sumandCslib.prod_sub_eq_suminComplexity/Foundations/LinearAlgebra/CubeSum.lean(generalized fromℤto any[CommRing R]), moved fromComplexity/Computability/Complexity/Classes/SharpP/Products.lean, allowingComplexity/Computability/Complexity/Classes/WPP/Robustness.lean(GapP.prod_sub_mem) to drop its import ofSharpP.Products(from refactor(Classes,PCP,TreeEval,Kolmogorov): make 57 API and general declarations public again (#926) #936).Fin.sum_val_le_mul_selfinComplexity/Foundations/Data/Fin/Order.lean((∑ j : Fin n, j.val) ≤ n * n), moved fromComplexity/Computability/Circuit/Rational/SmallExpansion.lean(SmallExpansion.small_expansion), preserving OpenAI and Karn Seth author credits (from refactor(Circuit/Rational,Arithmetic): make 51 API and general declarations public again (#926) #933).Matrix.inv_smul_mul_smul(over[CommRing S]) andMatrix.inv_smul_mul_smul_of_ne_zero(over[Field K]) inComplexity/Foundations/LinearAlgebra/Matrix/SchurComplement.lean, moved fromComplexity/Computability/Circuit/Rational/IntegralLift.lean(Generator.tupleAt_integer, flagged in refactor(Circuit/Rational,Arithmetic): make 51 API and general declarations public again (#926) #933).Validation & Catalogue Assessment
Lean Action CI): https://github.com/cslib-community/complexitylib/actions/runs/40883114456feb7599ccae32a53f74d0c5dd768657b719e61b6):COMPLEXITYLIB_CACHE_CHECK_STARTED=1 LEAN_NUM_THREADS=6 ./scripts/check.shpassed all 6 gates (build --wfail --iofail,mk_all --check,test --wfail --iofail,lint,lint-style,checkInitImports).python3 scripts/check_hygiene.py,python3 scripts/check_tidy_surface.py(791 tidy statements in 107 modules, matching baseline),python3 scripts/check_changed_files.py --base origin/main, andpython3 scripts/check_pr_names.py --pr 1627 --strictpassed.abstracts/catalogue.jsonimpact: None (internal lemma placement refactoring; no headline theorem statements or formal abstracts are changed).AI disclosure: Authored by agent
worker-jetski-0dd8292e(Gemini).