Repository navigation
refactor(Foundations, Logics): shared separation, cut-start, omitted-pair and rank-zero arguments - #4999
refactor(Foundations, Logics): shared separation, cut-start, omitted-pair and rank-zero arguments#4999SamuelSchlesinger wants to merge 5 commits into
Conversation
…eps once The forth step proved each pebble-separation fact twice, once in M and once in N, and the two cases (extend a cluster / open a new one) repeated the same Fin.lastCases analysis. Private helpers over an arbitrary structure now carry it: sep_snoc (separation of an extended tuple), lt_edist_of_mem_ball_of_sep, lt_edist_of_not_mem_ball and not_mem_ball_of_sep (disjoint cluster balls). The M/N fields and disjM/disjN are one-line applications.
…ox coordinates isOrthogonal_cutStart and isSimple_cutStart repeated the same case split; a private cutStart_of_cut_first takes the property's dilation and first-segment-cut lemmas. eq_of_inPointBoxes proves the one-coordinate disjointness once and applies it to both coordinates.
…f sum_omitted_le The omitted pairs with p.2 < p.1 were bounded by a copy of the p.1 <= p.2 argument with sum_product_right. A local row bound for any subset of the first kind now serves both halves; the second half is its image under Prod.swap, using the symmetry of the weight.
…orphism step
bijPebbleWins_of_forall_same_univ derived the partial isomorphism from
counting-formula agreement twice (zero and succ cases). A private
partialIsoOn_of_forall_infinitaryCountingFormula does it once, by reduction
to the existing L^k_{inf,omega} lemma through toCounting.
… projections The pair, comp and prec branches of hG each rebuilt the same five projections out of the step context; they are now defined once before primrec_recOn.
|
Agent review claim: coordinator |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator review (coordinator agy-634bba4c, session 634bba4c-9d3c-4f80-8d5b-6097f495b913) of head 9e4179e8d8ff99857ea42684e45b9410b38a8e97: APPROVE.
Verified across all five touched modules (Logics/FirstOrder/Locality/Sharp.lean, Foundations/Geometry/Orthogonal/Trim.lean, Foundations/Analysis/SignedDigitStream/Multiplication.lean, Logics/FirstOrder/FiniteVariable/Infinitary.lean, Foundations/Computability/RecursiveInEvalnPrimrec.lean):
- Every public statement, definition, import, docstring, and
@[expose]boundary is unchanged; all seven added helpers areprivateand well-scoped (sep_snocand its ball-disjointness helpers inSharp.lean,cutStart_of_cut_firstandhcoordinTrim.lean,hrows+Prod.swapsymmetry inMultiplication.lean,partialIsoOn_of_forall_infinitaryCountingFormulainInfinitary.lean, and hoistedprimrec_recOnprojections inRecursiveInEvalnPrimrec.lean). - Checked all four "left as is" items against source (
Tensor/Primal.lean,TreeLikePigeonhole.lean,MonotoneExtraction.lean, and the remainingSharp.leanpairs); each reflects a genuine structural difference rather than missed duplication. - Local
check_hygiene.py --check-simp,check_projection_chains.py,check_encoding_readability.py, andcheck_operator_manual.pyall pass.
Non-blocking nit: cutStart_of_cut_first in Trim.lean only applies hdil at r, so (hdil : P (dilateRoute k r)) without hP would also cover support_cutStart_subset. Holding queue placement until ci-checks finishes and its advisory notices are checked.
This is agent review, not human review.
Part of #3725 (repeated proof machinery). Author: Jetski worker sessions
025a212a(delegating) and7b499feb(implementation), branchproofs/foundations-logic-twins. This PR is its own task record.Five proof-only refactors, one commit per file, removing twins flagged by
scripts/proof_copies.py:Logics/FirstOrder/Locality/Sharp.lean,ClusterWitness.forth. Each separation fact was proved twice (forMand forN), and both cases repeated the sameFin.lastCasesblock. Five private helpers, generic over the structure, now carry the argument:sep_snoc,lt_edist_of_mem_ball_of_sep,lt_edist_of_not_mem_ball,not_mem_ball_of_sepandcast_two_pow_le_succ.sepM/sepN/disjM/disjNare 1–3 line applications, and about 115 lines of duplicated case analysis are gone.Foundations/Geometry/Orthogonal/Trim.lean. The privatecutStart_of_cut_firstis parameterized by a route property, its dilation lemma and its first-segment cut lemma.isOrthogonal_cutStartandisSimple_cutStartbecome term-mode applications.eq_of_inPointBoxesproves one-coordinate disjointness once and applies it to both coordinates.Foundations/Analysis/SignedDigitStream/Multiplication.lean,sum_omitted_le. A localhrowsbounds the first kind of omitted pair. The second kind, previously amin_eq_right/sum_product_rightcopy, is itsProd.swapimage, using the symmetry of the weight.Logics/FirstOrder/FiniteVariable/Infinitary.lean.bijPebbleWins_of_forall_same_univbuilt the rank-0PartialIsoOntwice. The privatepartialIsoOn_of_forall_infinitaryCountingFormulabuilds it once, derived from the existingpartialIsoOn_of_forall_infinitaryFormulathroughtoCounting. This also removes the atomic-case copy across the two syntaxes.Foundations/Computability/RecursiveInEvalnPrimrec.lean. Three identical 10-line blocks ofPrimrecprojections inprimrec_recOnare defined once. This one is plumbing.No public statement, name or attribute changes; the only additions are private helpers. Net −62 lines (+185/−247).
proof_copies.pyreports no repeated block in the 271 proofs of these files.Left as is:
Tensor/Primal.lean(a shared reduction lemma is line-neutral); the row/column halves ofTreeLikePigeonhole.isMatching_update_true(they would need transpose infrastructure);MonotoneExtraction(different gates); theinl/inrtwins ofSharp.lean's bespoke counterexample.This is refactoring only, with no new mathematics.
Validation:
lake build --wfail --iofailof the five modules and all importers (CslibFrontierTests.FOLocalitySharp,SAT.ExactOne.GeometryCollar,Orthogonal.Directions,SignedDigitStream.Reciprocal,ZeroOneLaw.Infinitary, the FiniteVariable Infinitary test,KleenePostJump,CslibFrontierResults.Entries);scripts/check.sh --quickpassed (44 affected targets, hygiene, ratchets, lint,mk_all --check). Single-file elaboration is unchanged within noise (two alternating runs per file; e.g. Sharp 5.3–7.2 → 5.6–6.0 s). CI does the full run.Manuals: neither the Operator's Manual nor the Agent Operator's Manual describes these proofs, so neither needs an edit.
AI assistance: prepared by AI agents (Jetski). Not reviewed by a human.