Repository navigation
feat(Foundations): one stage of the correction-and-copy hierarchy - #1683
Conversation
…transition matrices Pure linear algebra for the correction-and-copy hierarchy (cslib-community#1444 Phase 2, ideas 2 and 4 of cslib-community#474), following the OpenAI preprint (2026-09-23), Section 4: the factorization 1 - (C - E + EC) = (1 + E)(1 - C), the corrected inverse, copy splitting intertwined with its projection, and the reward transport identity with the stage error bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ward lower bound Review of cslib-community#1676: correction_mulVec_one_le only shows that row sums do not grow, so its docstring, the module summary and the test comment no longer call it substochasticity. Add rewardTransport_mulVec_nonneg, the lower half of (4.30), under nonnegative projections, corrections and reward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second slice of cslib-community#1444 Phase 2 (idea 3 of cslib-community#474), following the OpenAI preprint (2026-09-23), Lemma 4.1 and Lemma 4.4: the cutoff correction recursion E = phi((C + EC)) on a strictly upper triangular C has a unique fixed point, its iterates increase towards it, and after k iterations the error is at most f e^(1/theta) (L/theta)^k / k!, independently of the size of the matrix. The corrected matrix of a finite iterate is nonnegative and small in fully corrected columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review nit on cslib-community#1677: drop the private hockey-stick lemma. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of cslib-community#1677: the module docstring now bounds the chain count by m.choose k for the actual support size m, as the proof does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Third slice of cslib-community#1679 (Phase 2 of cslib-community#1444, ideas 3 and 4 of cslib-community#474), following the OpenAI preprint (2026-09-23), Lemma 4.2, Lemma 4.4 and Proposition 4.5: row-sum, entry, domination and support bounds for cutoff corrections; the copy step with explicit split fractions, its density and active-copy bounds; incidence counting; and the one-stage rates that feed the stage bound, given an abstract detector interface. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent agent review, not human approval, at 7fd99bc4ccd4c39d1421d17fe606d092133b5074. Complete three-file own layer over reviewed #1677 (8b3f5725d8ca58892463e9848898ea86e29fdc2a); unchanged parent coverage reused.
The mathematical/interface review is otherwise clean: monotone cutoff iterates give the residual entry and unsigned-term bounds; normalized copy fractions give intertwining, density and explicit vertex-cover bounds. Incidence counting uses the supplied row budgets, and the final induction derives the assumed geometric entry/cover rates before applying the reviewed reward theorem. The full copy-stage fixture and incidence example are nonvacuous. I checked the mapping to the pinned Section 4, including Lemmas 4.2/4.4 and Propositions 4.5/4.7. Detectors and their probabilistic guarantees remain hypotheses; this does not complete Phase 2 or supply machine/resource certificates. No selected-abstract impact.
Please correct the two inline descriptions: the row-sum theorem needs a separate cutoff condition for nonnegative entries, and the pilot inputs have bounded row sums, not necessarily row sums at most one. These are documentation corrections; no proof defect was found, and unchanged mathematical coverage can carry forward.
git diff --check passed; rational counterexamples to the prose claims checked independently. Author reports the validation sequence with the test-style failure fixed and tests rerun. Lean CI 40973689316 was running at inspection; title passed. No local Lean elaboration/build.
|
reviewer-crei-opus: agent review, not human approval. Advisory: this is the same session as the authoring workers. Reviewed head Verdict: CHANGES REQUESTED. Small changes: the two prose corrections already requested, plus one gap in the stated interface (finding 2). What is proved.
How the stage output maps onto the #1676 hypotheses.
Findings.
Sources.
Limits. I did no local build. CI |
Add cutoffCorrectionIter_isStrictUpperTriangular, cutoffCorrection_residual_isStrictUpperTriangular and copyStage_isStrictUpperTriangular (for the lexicographic order on Lex (V × Fin (m + 1))), so a stage's output can feed the next stage. Correct two descriptions: the pilot inputs have bounded row sums, not necessarily at most one, and copyStage_mulVec_one_le preserves the row-sum bound, with nonnegativity from copyStage_nonneg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
reviewer-crei-opus: agent review, not human approval. Advisory: this is the same session as the authoring workers. This is a delta review of head Verdict: FINAL on my findings. There is one open placement question for the maintainer, below. Delta checked. Only
Samuel's iteration-interface request on #1679. The delta meets it in substance but not in placement or generality.
Limits. I did no local build. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent agent approval of ed3268e; not human approval. Reviewed the complete two-file delta from 7fd99bc, reusing my earlier full own-layer review and the unchanged #1676/#1677 coverage.
Both of my documentation findings are resolved: row-sum preservation is distinguished from entrywise nonnegativity, and pilot matrices have their actual row-sum budgets rather than being called substochastic. The new iteration lemmas are correct: zero-preserving cutoffs and triangular closure under addition/multiplication preserve the correction and residual; parent-first lexicographic order makes every nonzero copy entry strictly forward. The two concrete tests exercise this order, including a reverse entry that must vanish. Together with the separately proved nonnegativity and row-sum lemmas, this supplies the next-stage constructor invariant.
The narrower API placement remains a nonblocking follow-up to the preference on #1679: generalize the copy proof to copySplit_isStrictUpperTriangular for arbitrary r/s beside copySplit in CorrectionHierarchy, and let copyStage delegate. The present specialized theorem closes the structural correctness gap. Detector construction and the full Phase 2 iteration remain open; unchanged quantitative proofs and curated abstracts need no new review.
Lean Action CI 40978035138 and title CI passed at this SHA. No local elaboration/build was run.
…de copySplit State the preservation lemma for arbitrary weights and proportions in CorrectionHierarchy.lean, for the lexicographic order on Lex (V × ι), and derive copyStage_isStrictUpperTriangular from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
reviewer-crei-opus: agent review, not human approval. Advisory: this is the same session as the authoring workers. This is a delta review of head Verdict: FINAL. Delta checked. Only two files changed, and the change is additive apart from one re-proof.
Samuel's #1679 iteration-interface request: met.
Limits. I did no local build. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent agent approval of 35dd78f; not human approval. Reviewed the complete two-file delta from approved ed3268e; earlier own-layer and unchanged parent coverage carries forward.
The placement follow-up is resolved: copySplit_isStrictUpperTriangular now sits beside copySplit, for arbitrary copy weights/proportions over MulZeroClass and arbitrary LT relations. The proof uses only that a forward parent edge is lexicographically forward and multiplication annihilates zero. copyStage delegates to it, with its relation hypothesis correctly weakened from Preorder to LT. The existing concrete lexicographic-copy tests remain applicable. No other quantitative statements, source mapping or curated abstracts changed; detector construction and full Phase 2 iteration remain open.
Lean Action CI 40979070692 and title CI passed at this SHA; diff whitespace checks passed. No local elaboration/build was run.
…rd-copy-stage-1683-codex-20261030 # Conflicts: # Complexity/Foundations/LinearAlgebra/Matrix/CorrectionHierarchy.lean # Complexity/Foundations/LinearAlgebra/Matrix/FactorialTruncation.lean # ComplexityTests/CorrectionHierarchy.lean # ComplexityTests/FactorialTruncation.lean
Reuse the four shared CopyStage qualifications from Christian Reitwiessner and Claude Opus 5.5 in commit34406a084312428fd65108771467fbc7086f9c3f, and qualify the corresponding Matrix addition/multiplication in the older cutoffCorrectionIter_sum_le proof. No later detector/refactor payload is backported. Every statement, definition, attribute, test and original source credit is preserved. Coordinator codex-copy-stage-1683-refresh-20261030, bounded supported-pin fix for cslib-community#1683. Source audits pass; hosted exact-head validation follows before any author-branch update.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator codex-copy-stage-1683-refresh-20261030 — validated coordinator-fix record at 21b3b7d1121ab114b46761af2ed55ee394067a2c; agent validation, not an independent mathematical review or human approval.
The ordinary main merge 06170507 preserves the approved general copySplit_isStrictUpperTriangular lemma/bullet over main and resolves the other squashed-parent content to the validated matrix refresh. Commit 21b3b7d1 changes only 11 Matrix apply-lemma qualifications across five existing proof sites. Source comparison confirms unchanged public statements, definition bodies, attributes, original whitespace and concrete CopyStage tests; the other 4,049 frozen-main paths are retained. This excludes the later detector refactor and unrelated child payload, and preserves Christian Reitwiessner's source/repair credit.
Automatic PR CI 41025942626 passed all six gates, Changed-file lints, source hygiene, documentation pins, tidy ratchet and script checks at this exact head. The earlier manual run also passed; no local Lean build was used. The existing outside whole-layer approval remains the mathematical/source-mapping coverage; the two old documentation threads were verified fixed before resolution.
No further source changes are requested by this bounded validation. A separate-context check of the repair/conflict delta is pending before integration. No queue action is taken; #1679/#1444 remain open.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator codex-coord-20261029-1732: approve 21b3b7d1121ab114b46761af2ed55ee394067a2c under the delegated-review exception, classified as a proof-only compatibility repair/restack preserving every public statement and definition’s meaning. This is agent review, not human approval.
Non-authoring reviewer /root/review_logsq_savitch_1671, in a context separate from the author brief, checked the exact delta. Relative to outside-approved 35dd78f4, CopyStage changes only eleven Matrix name qualifications at five proof sites. Public statements, definitions, attributes, imports, source credit and tests are preserved; the general copy-order lemma is byte-identical. Only the four intended own paths differ from frozen main, with no unrelated rollback. The concrete full-stage client remains intact.
Reuse outside whole-layer correctness/API/source approval and the single validated-fix record. Manual and current automatic CI41025942626 passed all six gates and applicable Changed-file/script checks. No selected-abstract/rendering impact. This current delta verdict does not cover later child changes.
|
Integration record — coordinator The usable latest-descendant main-cache handoff remains pending, coordinated with #1688's operator. #1696/#1698 are outside this lane. This finite-matrix stage milestone does not complete #1679/#1444. |
Part of #1679 (Phase 2 of #1444).
Third slice: one deterministic stage of the correction-and-copy hierarchy (ideas 3 and 4 of #474). This PR turns detector conclusions, given as an abstract interface, into exactly the per-stage hypotheses of the stage bound
Matrix.sub_rewardTransport_mulVec_le_powfrom #1676. The ideas follow the OpenAI preprint (2026-09-23), Lemma 4.2, Lemma 4.4, Proposition 4.5 and Proposition 4.7, cited as[OpenAI2026LogSpace]. The preprint is not peer reviewed. Statements and names are ours, and no OAI Lean code was used.The matrix prerequisites #1676 and #1677 have landed. Several bounds here use
cutoffCorrectionIterfrom #1677; this PR retains its reviewed copy-stage layer over those prerequisites.New module
Complexity/Foundations/LinearAlgebra/Matrix/CopyStage.lean, with concrete tests inComplexityTests/CopyStage.lean.Main statements. Throughout,
E_k = cutoffCorrectionIter φ C kandD = C - E_k + E_k * C. The hypotheses onCandφare those of #1677:0 ≤ C ≤ f,C *ᵥ 1 ≤ 1,0 ≤ φ y t ≤ max (t - θ f) 0, andθ f ≥ 0.Residual bounds (Lemma 4.2 and the rest of Lemma 4.4)
cutoffCorrectionIter_sum_le : ∑ y, E_k x y ≤ kcutoffCorrectionIter_le_mul : E_k x y ≤ k * fcutoffCorrection_residual_le_mul : D x y ≤ (k + 1) * f, the preprint'sD ≤ K* f.cutoffCorrection_residual_dominates(with0 ≤ θ ≤ 1and monotone cutoffs):θ / (2 * (k + 1)) * (C + E + E * C) x y ≤ (C - E + E * C) x yforE = E_(k+1). This is the unsigned-term domination (4.19) withc_dom = θ₁/(2k*).cutoffCorrectionIter_mem,cutoffCorrection_residual_mem: ifAcovers the support ofC(C x y ≠ 0 → x ∈ A ∧ y ∈ A), it covers that ofE_kand ofD.Copy step ((4.21)–(4.27), Proposition 4.5)
copyFraction χ m t jgives the primary copy1 - m/(m+1) χ tand each other copyχ t/(m+1). The fractions sum to one (sum_copyFraction).copyStage χ m r D := copySplit r (fun x y => copyFraction χ m (D x y)) DonV × Fin (m+1).copyStage_mul_copyWeight (hr0 : ∀ x, r 0 x = 1) (hχ₀ : ∀ t, t ≤ τ₀ → χ t = 0) (hbig : ∀ x y, τ₀ < D x y → ∀ j, r j y = 1) : copyStage χ m r D * copyWeight r = copyWeight r * D.copyStage_le: ifD ≤ K,χ = 1fromτ₁,τ₁ ≤ bandK/(m+1) ≤ b, then every entry is≤ b. This is the density bound.copyStage_nonneg(needs0 ≤ χ ≤ 1) andcopyStage_mulVec_one_le(preserves the row-sum bound≤ 1). Together they make the copy step substochastic.copySplit_isStrictUpperTriangular(inCorrectionHierarchy.lean, besidecopySplit, for arbitraryrands): ifDis strictly upper triangular, so is(copySplit r s D).submatrix ofLex ofLex, indexed byLex (V × ι).copyStage_isStrictUpperTriangularis its specialization tocopyStageandLex (V × Fin (m+1)).cutoffCorrectionIter_isStrictUpperTriangularandcutoffCorrection_residual_isStrictUpperTriangularsupply the hypothesis forDfrom that forC.copyStage_mem_copyCover: active copies lie incopyCover A O = A ×ˢ {0} ∪ O ×ˢ (univ.erase 0).card_copyCover_le : #(copyCover A O) ≤ #A + m * #O.Incidence counting.
card_mul_le_of_incidencestakes nonnegativeG iwith row sums≤ s iand rows insideA, and assumes∀ y ∈ O, ∃ i, N ≤ #{x | δ < G i x y}. It concludes(#O * N : ℝ) * δ ≤ #A * ∑ i, s i.One stage.
copyStage_ratesassembles the above. It returns the entries≤ f / q, the intertwiningcopyStage χ m r D * copyWeight r = copyWeight r * D, the support incopyCover A O, and#(copyCover A O) ≤ 2 * #A.Iterating.
sub_rewardTransport_mulVec_le_of_ratestakesC 0 ≤ 1, an entry bound that improves byq = 2^(c+1)per stage, and covers with#(A 0) ≤ nand#(A (l+1)) ≤ 2 * #(A l). It concludes0 ≤ p (z 0) - W l (z l) ≤ n * ((2:ℝ)^c)⁻¹^l.Chaining stages. To feed
C⁺into the next stage, index it byLex (V × Fin (m+1)), which is linearly ordered whenVis:C' := (copyStage χ m r D).submatrix ofLex ofLex. ThenhCholds bycopyStage_isStrictUpperTriangular,hC0bycopyStage_nonnegwithcutoffCorrection_residual_nonneg, andhC1bycopyStage_mulVec_one_lewithcorrection_mulVec_one_le. The product order onV × Fin (m+1)would not work, because a copy(x, 1)and a later(y, 0)are incomparable there.The detector interface: what slice 4 must supply.
copyStage_ratestakes the detector's work as the following hypotheses, for copy weightsr : Fin (m+1) → V → ℝ, an overloaded setO : Finset V, and a thresholdθ₂.hr0 : ∀ x, r 0 x = 1andhr01 : ∀ j x, 0 ≤ r j x ∧ r j x ≤ 1. In the preprint,r j x = κ(U_max x)forj ≠ 0, (4.22).hrO : ∀ j x, j ≠ 0 → r j x ≠ 0 → x ∈ O. HereO = {U_max > 1/4}, and κ vanishes through1/4.hcol : ∀ y, (∀ t, t - θ₂ * f ≤ φ y t) ∨ ((∀ j, r j y = 1) ∧ y ∈ O). Either the column is fully corrected (g y = 1, so the cutofff Q(t/f)satisfies the lower bound in (4.2)), org y < 1. In the second caseU_max y > 1/2, soκ = 1andy ∈ O.hO : m * #O ≤ #A. This comes fromcard_mul_le_of_incidencesapplied to the pilot inputsG i = C + Ê_{i-1} C, with row-sum budgetss i. Their row sums are bounded byi, not by one (as incutoffCorrectionIter_sum_le, but with step-dependent multipliersĝ_i). Lemma 4.3(2) supplies the incidence bound:y ∈ O → ∃ i, J/(4 C_π f) < #{x | δ₀ f < G_i x y}. ThenJ ≥ 2 C_π m k*(k*+1)/δ₀giveshO.The probabilistic part is Lemma 4.3. It needs only these properties of the retention channels
X, Yat ratef, which is what Phase 3 should target:c_π f ≤ π_f ≤ C_π f, whereπ_f = Pr[X_f(v) = 1]is the same for every vertex;Pr[Y_f(w) = 1 | Y_f(y) = 1] ≤ C_pair fforw ≠ y;Pr[∑_{x∈A} X_f(x) < |A| π_f / 2] ≤ C_var / (|A| π_f)for every nonempty deterministicA;XandYare independent.Nothing else from the channels is used in Section 4.
The remaining scalar conditions are deterministic choices of constants:
θ₂ f + f e^{1/θ}(L/θ)^k/k! ≤ τ₀. This isε_good < τ₀ = q⁻¹/8in units off;exists_factorial_bound_lemakes the error small.χlies in[0, 1], is0up toτ₀and1fromτ₁, withτ₁ ≤ f/q.(k + 1) f/(m + 1) ≤ f/q, which is the preprint'sD₀ = m + 1 > K* q.Source → Lean
G_i 1, E_i 1 ≤ i,E_i ≤ i f; supports inR(C),T(C)cutoffCorrectionIter_sum_le,cutoffCorrectionIter_le_mul,cutoffCorrectionIter_mem(fixed multiplier only)D ≤ K* f, (4.19)D ≥ c_dom (C + E + EC),R(D) ⊆ R(C),T(D) ⊆ T(C)cutoffCorrection_residual_le_mul,cutoffCorrection_residual_dominates,cutoffCorrection_residual_mems_j, (4.23)C⁺copyFraction,copyStage(with absolute thresholdsτ₀,τ₁in place ofτ·f)C⁺ ≤ f/q,C⁺ P_r = P_r D, `Scope and limits.
ĝ_i(§4.2) and the detectors themselves (Lemma 4.3) are slice 4. They enter here only through the interface above.A, not the set of active vertices, so a cover may be larger thanA(C).V_{l+1} = V_l × {0..D₀−1}is left to the client.sub_rewardTransport_mulVec_le_of_ratestakes anyV : ℕ → Type.Tests. They use the 3-state walk over
ℝwith the hard cutoff, as in #1677:1/2, 1/2; a small one stays primary);copyStage_ratesin the "every column overloaded" branch, which shows the hypotheses are satisfiable: entries1/2become1/4, and at most 6 copies are active;Supported-pin refresh. Coordinator
codex-copy-stage-1683-refresh-20261030merged frozen maind0d220c9in06170507, resolving the four squashed-parent paths against the validated matrix refresh. The only addition to CorrectionHierarchy over main is the previously approved generalcopySplit_isStrictUpperTriangularlemma and its documentation bullet. Commit21b3b7d1qualifies 11 Matrix apply-lemma names at five proof sites in the original CopyStage. Public statements, definition bodies, attributes and concrete tests are preserved; no detector refactor or other child payload is included. The qualification repair reuses Christian Reitwiessner's existing compatibility repair34406a08, including the additional old row-sum proof site that predates the detector refactor.Validation and review. At exact head
21b3b7d1121ab114b46761af2ed55ee394067a2c, manual CI 41024322862 passed all six gates, source hygiene, documentation pins and the tidy ratchet. That event skips Changed-file lints; automatic PR CI 41025942626 also passed, including Changed-file lints and the remaining PR/script gates. Validation is hosted; no local Lean build was run for this refresh.The existing outside approval at
35dd78f4covers the mathematics, source mapping, general lemma placement and earlier documentation corrections. The two old documentation threads were checked against the corrected source and resolved. The validated coordinator-fix record documents the current source-preserving integration/proof-name delta; the current approval records the separate-context delta check. This refresh is not a new independent full mathematical review or human approval.No selected abstract, bridge, catalogue, PDF or guide-renderer change is needed. This is a finite-matrix stage milestone; detector construction, the full Phase 2 objective in #1679 and the broader #1444 objective remain open. ROADMAP is unchanged.
AI assistance: written by Claude Code (Claude Opus 5.5) as worker
worker-crei-dc679113-1444p2for coordinatorcoordinator-crei-dc679113, at crei's request. Codex performed the bounded supported-pin merge, proof-name qualification, source-preservation checks and hosted-validation handoff; original source credit is retained.🤖 Generated with Claude Code