Repository navigation
refactor(CompositionAlgebrasOverRings): deduplicate proofs flagged in review - #674
Conversation
… review Address the code-quality findings of the LLM review of LeanPool#665. - Composition/Reduced/Classification: the LG-ring and PID versions of the rank-four and rank-eight splitting theorems, and of split <-> isotropic, become wrappers around the versions under GPR's freeness hypothesis. The PID witness is the new ProjectiveConstantRankFree.of_isPrincipalIdealRing. - Move Module.Finite.of_linearEquiv_prod and Module.Projective.of_linearEquiv_prod from LGRing/ConstantRank down to Module/Unimodular, next to LinearMap.equivProdKerOfApplyEqOne, and use them in place of three hand-built kernel projections in Conic/Projective and Composition/RankDichotomy. - Composition/ComplexQuaternion: delete two unused private lemmas and correct the implementation note that described them. No existing statement changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Low impact] No blocking issue was found in the proof refactor or its public imports. SummaryThis proof-only refactor shares the classification arguments and the proofs that a kernel is finite and projective.
Reviews (1) · Last reviewed commit: "refactor(CompositionAlgebrasOverRings): ..." · Reviewed by Greptile |
Vilin97
left a comment
There was a problem hiding this comment.
{
"summary": "Reviewed all six complete diffs and the full changed modules at cc213de. The six LG/PID specializations now use the existing abstract freeness/classification theorems; their written public statements and surrounding hypotheses are preserved. The PID witness correctly supplies freeness for finite projective modules. The three unit-form-kernel arguments use the existing splitting equivalence and the same finite/projective complement lemmas, which have moved unchanged to Module/Unimodular. The removed private quaternion lemmas had no callers; the actual computations already use Mathlib's quaternion lemmas.\n\nThe project card, public entry/import modules, toolchain, manifest and lake configuration are unchanged. I found no source changes needed. This approval records the source review: authored run 39097751505 and main's separate push run 39094676507 were still building in the validation snapshots. Protected integration awaits applicable checks and the existing main-CI hold; no compile-time improvement is claimed.",
"assessment": {
"scope": "Existing CompositionAlgebrasOverRings refactor: six files, 62 additions and 159 deletions.",
"introduces_tech_debt": false,
"maintainability": "improved",
"brittleness": "more_robust",
"risk": "low",
"assessment_one_sentence": "Shared typed proofs replace repeated constructions while preserving the mathematical contracts, imports and public exposure."
},
"verdict": "approve",
"findings": []
}
🤖 LLM review — refactor (
|
| Aspect | Value |
|---|---|
| Scope | proof deduplication and helper relocation |
| Introduces tech debt | ✅ no |
| Maintainability | ✅ improved |
| Brittleness | ✅ more_robust |
| Risk | ✅ low |
Centralizing the shared arguments reduces maintenance work while retaining the structured proofs and reusable helpers.
Tokens: 636,373 in / 5,471 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $2.6276 (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.
Follow-up to #665. This addresses the two proof-duplication findings in the code-quality rubric of the LLM review, and the unused private quaternion lemmas noted in the source review. It changes only
LeanPool/CompositionAlgebrasOverRings/**/*.lean. No existing statement, definition, import or card entry changes. One theorem is added and two unused private lemmas are removed.Classification specializations (
Composition/Reduced/Classification.lean). The rank-four and rank-eight splitting theorems over LG rings and over PIDs, and the LG and PID forms of split ↔ isotropic (GPR 22.18,GPR 22.19), each repeated the argument of the matching theorem under GPR's freeness hypothesis. They are now wrappers that supply the freeness witness. Over an LG ring that is the existingProjectiveConstantRankFree.of_isLGRing. Over a PID it is the newProjectiveConstantRankFree.of_isPrincipalIdealRing: a finite projective module over a PID is torsion-free, hence free. The abstract rank-four and rank-eight theorems now come before their specializations.Kernel splitting (
Conic/Projective.lean,Composition/RankDichotomy.lean).norm_eq_of_projective,traceDefect_eq_zero_of_projectiveandeq_unitForm_smul_one_of_rankAtStalk_eq_oneeach built a projection ontoker unitFormby hand to get theModule.FiniteandModule.Projectiveinstances on it.Module.Finite.of_linearEquiv_prodandModule.Projective.of_linearEquiv_prodmove unchanged fromLGRing/ConstantRank.leandown toModule/Unimodular.lean, next toLinearMap.equivProdKerOfApplyEqOne. All three proofs now get the instances from that splitting.Unused helpers (
Composition/ComplexQuaternion.lean). This deletes the privatequaternion_mk_mulandquaternion_star_mk, which nothing used. It also corrects the implementation note, which said the quaternion arithmetic went through them.Validation, run locally against the pinned Lean and Mathlib:
lake build LeanPool.CompositionAlgebrasOverRings.Imports: no warnings.lake env lean --run scripts/ci/lint-project.leanon all 106 project modules: passed (2969 declarations).lake exe lint-style LeanPool,lake exe mk_all --module --checkandgit diff --check: passed.lean_pool.qualitychecks, scoped to this project: passed. These cover the static repository checks, the card's declarations, the axiom audit (1548 declarations) and the option-backdoor audit._proof_N/_simp_Nauxiliaries, the two dumps differ in exactly three entries: the addedProjectiveConstantRankFree.of_isPrincipalIdealRingand the two removed private lemmas. The movedof_linearEquiv_prodlemmas have identical types.🤖 Generated with Claude Code