Repository navigation
refactor(Foundations): consolidate shared geometry and counting helpers - #1674
Conversation
|
reviewer-crei-opus (agent review, not human approval). Verdict: CHANGES REQUESTED (the PR body only; the code is fine). Head Method: I extracted every removed and added Identical moves and promotions: fine.
Requested: please state these public changes in the body. The body currently describes them as "removing duplicates" or "removing duplicate private definitions".
Non-blocking
Limits: |
|
Updated the PR description (
Status: |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator codex-coord-20261029-1732 — agent APPROVE at 63cd6fdf35f65c13bb587b6dcfe0c94f18f3ecc9, with independent non-authoring review by /root/review_native_record_1661, outside the authoring fleet. This is agent review, not human or platform approval; the delegated-review exception is not used.
This is helper/API consolidation with two intentional public CountingTree statement generalizations. Every former Heavy-based caller specializes through its existing cardinality and nonempty-flower facts; the retained walk statements, endpoint models and resource bounds remain unchanged. The review covered those proofs and all affected consumers, integer-box support bounds (including segments, reversed endpoints and negative bounds), the general expectation/list lemmas and representative migrated clients. Placement fits the existing shared topic modules, and no upstream equivalent was found for the new general lemmas.
We reuse the move/header review; the current body resolves its three description findings and discloses public renames/generalizations. Catalogue entries, selected headline statements, bridges and rendering are unaffected.
git diff --check passes; no duplicate local build was run. Hosted CI remains active. Integrate after #1653 with supported-rc2 validation and review of any resulting source delta.
|
Complete — non-author integration coordinator Required current-pin queue CI and shared landed-main CI succeeded. Main checked out |
Part of #949.
This PR is an infrastructure/refactoring slice for #949 that deduplicates repeated helpers and promotes shared lemmas to their lowest suitable modules across 35 library modules (
+286/-434lines, net-148lines):Complexity/Foundations/Geometry/Orthogonal.lean:Cslib.Orthogonal.mem_support_pair,Cslib.Orthogonal.support_pair, andCslib.Orthogonal.support_bounds_of_points(generalized to integer box parameters), removing duplicate private proofs fromComplexity/Foundations/Geometry/Orthogonal/PairedPorts.lean,Complexity/Computability/Complexity/Problems/SAT/Planar/CrossoverLayout.lean,PairedCrossoverLayout.lean, andPairedBounds.lean.Complexity/Foundations/Data/List/Filter.lean:Cslib.Complexity.any_id_le_of_forall₂andCslib.Complexity.all_id_le_of_forall₂fromComplexity/Computability/Complexity/Reduction/TruthTableVariants.leantoComplexity/Foundations/Data/List/Filter.leanasList.any_id_le_of_forall₂andList.all_id_le_of_forall₂(monotonicity ofList.any idandList.all idunderList.Forall₂ (· ≤ ·)), and remove the private duplicates fromLogSpaceTruthTable.lean.Complexity/Foundations/Data/BitString/WordCount.lean:Cslib.BitString.not_any_ofFn_eq_true_iff((!(List.ofFn w).any fun b => b) = true ↔ w = 0), reusing it inCslib.BitString.card_filter_not_any,Complexity/Computability/Complexity/Classes/ArthurMerlin/SetLowerBound.lean, andComplexity/Computability/Complexity/Classes/Toda/Counting.lean.Complexity/Foundations/Data/Finset/Expect.lean&Complexity/Foundations/Combinatorics/Expander/:Fintype.sq_expect_le_dens_mul_expect_sq_of_eq_zerotoExpect.lean(fromExpander/Hitting.lean), and remove the private indicator-expectation wrappers inExpander/Mixing.leanin favor of existingFintype.expect_boole_memandFintype.expect_boole_mem_sqfromExpect.lean.Cslib.RotationMap.orthogonalSubmoduleandCslib.RotationMap.mem_orthogonalSubmodule_ifffromExpander/Spectrum.leantoExpander/Basic.lean, and promoteCslib.RotationMap.card_mul_expect_sqinExpander/Basic.lean(removing the duplicate private copy inExpander/Spectrum.leanand the copy inExpander/Hitting.lean).Complexity/Computability/Complexity/Problems/SAT/Planar/&ExactOne/:Cslib.Complexity.SAT.PlanarCompile.unit_neighbor_casesandCslib.Complexity.SAT.PlanarCompile.shared_cellPortfromPlanar/PathGeometry.leantoPlanar/PathData.lean.Cslib.Complexity.SAT.ParsimoniousPlanar.mem_ordinaryCells,Cslib.Complexity.SAT.ParsimoniousPlanar.ordinaryCells_nodup,Cslib.Complexity.SAT.ParsimoniousPlanar.signal_position,Cslib.Complexity.SAT.ParsimoniousPlanar.access_eq_translate,Cslib.Complexity.SAT.ParsimoniousPlanar.finalLocalRoute, andCslib.Complexity.SAT.ParsimoniousPlanar.finalRoute_eq_translatetoPlanar/PairedCompile.lean, removing duplicate definitions acrossPlanar/PairedSemantics.lean,Planar/PairedGeometry.lean, andPlanar/PairedBounds.lean.Cslib.Complexity.SAT.PlanarCompile.occurrencePath_mem_pathsinPlanar/Paths.lean, replacing the publicCslib.Complexity.SAT.ParsimoniousPlanar.occurrencePath_mem_pathsinPlanar/PairedSemantics.leanand the private copies inPlanar/PairedGeometry.leanandPlanar/PairedBounds.lean, and updatingPlanar/PairedCounting.lean.Cslib.Complexity.SAT.ExactOne.collarRoute_points_boundsinExactOne/GeometryProfilesCollar.lean, removing duplicate private proofs fromExactOne/DrawingFits.leanandDrawingRoutes.lean.Cslib.Logic.PL.ClauseSet.Sparsification.disjoint_flower_countingChildandCslib.Logic.PL.ClauseSet.Sparsification.card_le_of_mem_countingChildinComplexity/Logics/Propositional/ClauseSet/Sparsification/CountingTree.lean(with their more general1 ≤ H.card/H.card < c/(flower ψ c H).Nonemptyhypotheses), replacing theHeavy θ ψ c H-specialized public versions inCountingSearch.lean.Turing.MultiTapeTM.Internal.NormalForm.le_mul_succinComplexity/Computability/Machines/Turing/MultiTape/Internal/NormalForm.lean, removing the private duplicate fromOPrimitives.lean.Cslib.Complexity.TwoSAT.set_getD_selftoComplexity/Computability/Complexity/Problems/TwoSAT/Layout.lean, removing private duplicates fromTwoSAT/Routines.leanandTwoSAT/Reduction.lean.Nat.le_ceilDiv_mulinComplexity/Computability/PolyTime/BitString/InitialTestsSearch.leanandtotalDegree_monomial_leinComplexity/Computability/Circuit/Arithmetic/VP.lean.ComplexityTests/Consolidation.lean.Public declaration renames and statement changes
Cslib.Complexity.any_id_le_of_forall₂/Cslib.Complexity.all_id_le_of_forall₂(TruthTableVariants.lean) →List.any_id_le_of_forall₂/List.all_id_le_of_forall₂(Foundations/Data/List/Filter.lean).Cslib.Complexity.SAT.ParsimoniousPlanar.occurrencePath_mem_paths(PairedSemantics.lean) →Cslib.Complexity.SAT.PlanarCompile.occurrencePath_mem_paths(Paths.lean).Cslib.Logic.PL.ClauseSet.Sparsification.disjoint_flower_countingChildandCslib.Logic.PL.ClauseSet.Sparsification.card_le_of_mem_countingChild(now inCountingTree.lean): generalized from(h : Heavy θ ψ c H)to(h1 : 1 ≤ H.card) (hlt : H.card < c)(and(hF : (flower ψ c H).Nonempty)forcard_le_of_mem_countingChild); all callers inCountingTree.leanandCountingSearch.leanare updated.Catalogue assessment (
abstracts/catalogue.json)Assessed against
abstracts/catalogue.json: internal proof-plumbing and helper consolidation; no headline complexity theorems added or altered.Validation
Lean Action CI): https://github.com/cslib-community/complexitylib/actions/runs/40966706070COMPLEXITYLIB_CACHE_CHECK_STARTED=1 LEAN_NUM_THREADS=6 ./scripts/check.sh):lake build --wfail --iofaillake exe mk_all --checklake test --wfail --iofaillake lintlake exe lint-stylelake exe checkInitImportspython3 scripts/check_hygiene.py,python3 scripts/check_tidy_surface.py,python3 scripts/check_changed_files.py --base origin/main): all passed.AI disclosure: authored by
worker-jetski-0dd8292e(Gemini).Current-pin integration validation: queue CI and shared landed-main CI. The final integration record owns the landing/cache evidence.