Skip to content

Split over-long proofs in AndersonConjecture - #756

Merged
Vilin97 merged 4 commits into
mainfrom
claude/split-long-proofs-andersonconjecture
Nov 5, 2026
Merged

Vilin97 merged 4 commits into
mainfrom
claude/split-long-proofs-andersonconjecture

Conversation

@Vilin97

@Vilin97 Vilin97 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Prerequisite for #712 (syntax-aware proof-length linter). That linter correctly finds 14 proofs in AndersonConjecture over the 200-line cap; the old text-based checker missed them because they were carried by private def ... : PLift (...).

  • Each long proof is split into named private helper lemmas (longest proof now 176 lines; most well under 150).
  • The PLift-valued *_proof defs are removed: their proofs now live directly in the theorems they backed (or become private theorems). Dead intermediate facts and duplicated blocks were dropped.
  • No statement, public declaration name or type changes; no set_option, sorry, native_decide or nolints.

Verified locally against current main with #712's linter enabled: lake build LeanPool.AndersonConjecture.Imports emits zero warnings; scripts/ci/lint-project.lean passes on all 51 modules (888 declarations); lake exe lint-style LeanPool passes.

Refs #723

🤖 Generated with Claude Code

Refactor every proof over 200 lines (as measured by the syntax-aware
long-proof linter in #712) into named helper lemmas. Proof carriers
disguised as PLift-valued defs or private abbrevs become theorems.
Statements and public declarations are unchanged.

Refs #723

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

RetriggerView in Greptile

[Low impact] The latest changes introduce no blocking issue; they only separate declaration prefixes from the declarations.

Summary

Splits long proofs in AndersonConjecture into private helpers and moves proofs out of their PLift wrappers.

  • Long AndersonConjecture proofs are split into named steps while keeping their results the same.

Reviews (4) · Last reviewed commit: "Put theorem headers on their own line af..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

Statement changes

⚠️ 1 declaration changed their statement across 1 file — a statement change is more than a refactor. Confirm each one is intended.

⚠️ Statements changed (1)
  • adicCompletion_ideal_fg — LeanPool/AndersonConjecture/AdicNoetherian.lean

1 declaration had only a binder renamed (most often a hypothesis marked unused as _h…); the proposition is unchanged, so these are not statement changes.

✍️ Binder renamed (proposition unchanged) (1)
  • close_up_aux_factor — LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean

Also: 107 declarations added, 15 removed. A reorganization moves declarations between files, which shows up here as an add in one file and a remove in another.

➕ Declarations added (107)
  • coeff_decomp_of_smul — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • eval_cauchy_stable — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • evalₐ_mk_smul_eq — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • exists_coefficients_of_successive_approximation — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • extract_filtration_rep — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • factorPow_comp_evalₐ_noeth — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • filtration_smul_le — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • ker_evalₐ_eq — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • lift_span_of_generators — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • map_pow_le_ker_evalₐ — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • mem_map_pow_iff_mem_pow_smul_top — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • mem_sup_pow_of_map_evalₐ_le — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • smodEq_of_consecutive_differences — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • adjoin_surjectivity_avoidance_bound — LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean
  • exists_associatedPrime_of_height_le_one — LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean
  • adjoin_from_prime_avoidance_bound — LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean
  • exists_associatedPrime_of_height_le_one — LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean
  • transcendental_of_mem_of_comap_eq_bot — LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean
  • avoidanceBaseObstacles — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceBaseObstacles_card_le — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceGoodPrimes — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceGoodPrimes_card_le — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceGoodPrimes_isPrime — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceGoodPrimes_ne_maximalIdeal — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceGoodPrimes_not_le — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceModFiber — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceModFiber_card_le — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceObstacles — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidanceObstacles_card_le — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidance_cardinal_bound — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidance_countable_of_countable — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidance_root_shift_countable — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidance_shift_mod_transcendental — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • avoidance_shift_transcendental — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • close_up_avoidance_step_of_adjoin — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • quotientLift — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • quotientLift_spec — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • span_not_le_associatedPrime — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • close_up_b2_divided_step — LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean
  • close_up_b2_recombine — LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean
  • close_up_aux_factor_divides_a — LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean
  • gcdComplexity_insert_image_div_le — LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean
  • card_assoc_primes_union_bot_le — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • card_mod_roots_le — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • card_shifted_roots_le — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • no_common_I_not_le_assoc — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • no_common_avoidance_bound — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • no_common_modular_transcendence — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • prime_height_le_one_mem_assoc — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • shifted_aeval_roots_countable — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • … +57 more
➖ Declarations removed (15)
  • adicCompletion_ideal_fg_proof — LeanPool/AndersonConjecture/AdicNoetherian.lean
  • adjoin_surjectivity_proof — LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean
  • adjoin_from_prime_proof — LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean
  • close_up_avoidance_step_proof — LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean
  • close_up_aux_b2_nonzero_proof — LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean
  • close_up_aux_factor_proof — LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean
  • close_up_aux_no_common_nonzero_proof — LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean
  • close_up_all_one_pass_aux_proof — LeanPool/AndersonConjecture/Jensen/CombinedStep.lean
  • mk_Iio_ord_lt_proof — LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean
  • transfinite_construction_proof — LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean
  • build_height_bound_proof — LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean
  • build_intersection_nsubring_proof — LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean
  • intersection_close_up_proof — LeanPool/AndersonConjecture/Jensen/KrullDomain/KrullDomain.lean
  • build_loc_away_ufd_proof — LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean
  • build_ufd_proof_proof — LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean

Statements are compared textually against the merge base (comments and whitespace ignored; by proof terms embedded in a type are treated as proof-irrelevant), the same method as physlib's /check-golf. Anonymous instances and examples are not tracked.

Compile cost of modified files — base → head

Heartbeats: 1,846,008 → 2,037,621 (+191,613, +10.4%). Commands: 460 → 666.

Per-file wall sum: 256.1 s → 144.2 s (-43.7%). Wall clock is measured under parallel load and is noisy; heartbeats are deterministic and are the regression signal.

Files: 12 compared — 2 cheaper, 8 costlier, 2 within noise (threshold: |Δ heartbeats| ≥ 1,000 and ≥ 1%).

Both sides are elaborated against the merge-base build of the pool — sound when only proofs and definition bodies change; a file whose statements changed may fail there and is flagged ⚠. Heartbeats come from disjoint root command traces with trace.profiler.useHeartbeats and synchronous elaboration, converted to maxHeartbeats units. Failed measurements are not classified as cheaper or costlier. Δ lines counts added/deleted lines from this PR diff.

File Δ lines HB base HB head Δ HB Δ HB % Wall base (s) Wall head (s)
LeanPool/AndersonConjecture/Jensen/KrullDomain/KrullDomain.lean +183/-448 381,531 269,716 -111,815 -29.3% 33.48 17.31
LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean +218/-262 297,898 398,473 +100,575 +33.8% 28.70 13.92
LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean +422/-404 66,957 137,693 +70,735 +105.6% 17.20 10.31
LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean +289/-305 88,102 143,441 +55,339 +62.8% 17.78 9.17
LeanPool/AndersonConjecture/Jensen/CombinedStep.lean +124/-96 166,411 199,896 +33,485 +20.1% 24.22 11.30
LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean +338/-402 284,986 307,230 +22,244 +7.8% 32.12 17.21
LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean +438/-446 115,518 136,770 +21,252 +18.4% 16.74 12.00
LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean +204/-221 47,270 45,375 -1,896 -4.0% 12.56 8.17
LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean +224/-203 49,396 50,405 +1,009 +2.0% 12.36 8.72
LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean +204/-197 58,178 59,182 +1,004 +1.7% 15.38 6.89
LeanPool/AndersonConjecture/AdicNoetherian.lean +259/-336 237,046 236,327 -719 -0.3% 29.56 18.03
LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean +222/-206 52,714 53,113 +399 +0.8% 15.99 11.22
Total +3,125/-3,526 1,846,008 2,037,621 +191,613 +10.4% 256.1 144.2

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

Its only callers were replaced by the coefficient-based argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vilin97 and others added 2 commits November 5, 2026 08:58
Restore the existing exported smul_lift_of_filtration contract and its bounded proof while retaining the long-proof decomposition.

The lemma remains available to downstream users even though current internal callers now use coefficient decomposition. Refs #723.
Main's text-based proof-size check only recognizes declarations that start
a line, so one-line 'include T in theorem' headers merged neighbouring
blocks into apparent 264/364-line proofs. Splitting the header is the
standard layout and keeps both checkers accurate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"summary": "The refactor separates the existing adic, avoidance, transfinite, height and UFD arguments into named proved helpers and removes their PLift proof wrappers. The current head restores the exported lifting lemma unchanged, resolving the sole compatibility finding while retaining the clearer proof structure. The restored exported smul_lift_of_filtration lemma keeps downstream compatibility even though internal callers now use the coefficient construction. Current normal CI and execution of the intended semantic checker remain pending.",
"assessment": {
"scope": "proof decomposition with public API compatibility restored",
"introduces_tech_debt": false,
"maintainability": "improved",
"brittleness": "unchanged",
"risk": "low",
"assessment_one_sentence": "The proof decomposition improves maintenance and the exact compatibility restoration resolves the only actionable finding."
},
"verdict": "approve",
"findings": []
}

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"summary": "The current follow-up only separates include/omit prefixes from declarations at 35 sites. All nonwhitespace tokens in the complete 50-module project remain unchanged from the reviewed compatibility restoration, including the exported smul_lift_of_filtration lemma. Current-head normal CI and execution of the intended semantic checker remain pending.",
"assessment": {
"scope": "formatting continuation of proof decomposition with public API compatibility retained",
"introduces_tech_debt": false,
"maintainability": "improved",
"brittleness": "unchanged",
"risk": "low",
"assessment_one_sentence": "The current exact-head continuation preserves the accepted mathematical contracts and proof structure."
},
"verdict": "approve",
"findings": []
}

@Vilin97

Vilin97 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

/review

Please review the current published head 4b1e37f. The independent source continuation is posted; older-head reviews and checks remain dated.

@Vilin97

Vilin97 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 LLM review — refactor (gpt-6.1-sol)

Reviewed head: 4b1e37f24ca68d279459789b3d4ca0de02ebf542

Verdict: ✅ approve

Extracts named private lemmas from PLift-backed proofs while preserving explicit case analysis and removing redundant constructions and duplicated arguments. All 51 project modules elaborated locally with the pinned dependencies. The CI build remains pending; both profiling jobs exhausted runner disk during cache restoration, leaving comparative compile cost unverified.

Aspect Value
Scope proof decomposition and PLift wrapper removal
Introduces tech debt ✅ no
Maintainability ✅ improved
Brittleness ➖ unchanged
Risk ✅ low

The extracted helpers make the arguments easier to navigate and repair without introducing opaque automation or actionable maintenance debt.


Tokens: 10,884,680 in / 17,071 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $43.7948 (Standard API equivalent; uncached input) (long-context rate)
Automated review against .github/REFACTOR_REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.

CI was not green for this commit at review time; this review does not replace CI.

@Vilin97

Vilin97 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Targeted validation at exact head 4b1e37f passed with Lean 4.35.0, pinned Mathlib, the unchanged proof-length plugin from #712, the normal project options and warningAsError.

All 29 project modules in the dependency closure of the 12 modified files compiled quietly with the intended semantic proof-length checker. The run also compiled 58 missing Mathlib dependencies. No old project products were substituted, and the restored public lifting lemma is included. The previously verified 200/201 boundary controls and original over-limit baseline were retained without rerunning them.

This establishes the targeted current-file checker result. Full-project build/lint/style/quality, required contexts and native integration remain separate. Both #756 and #757 still need their normal protected merges before #712; #723 remains open until that work is integrated.

@Vilin97
Vilin97 added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit c0b2df7 Nov 5, 2026
24 of 26 checks passed
Vilin97 added a commit to loefflerd/lean-pool that referenced this pull request Nov 5, 2026
Brings in the long-proof splits from LeanPool#756 and LeanPool#757 so the new linter passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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