Skip to content

feat(Foundations): one stage of the correction-and-copy hierarchy - #1683

Merged
SamuelSchlesinger merged 11 commits into
cslib-community:mainfrom
chris-ai1:feat/copy-stage-1444
Oct 30, 2026
Merged

SamuelSchlesinger merged 11 commits into
cslib-community:mainfrom
chris-ai1:feat/copy-stage-1444

Conversation

@chris-ai1

@chris-ai1 chris-ai1 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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_pow from #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 cutoffCorrectionIter from #1677; this PR retains its reviewed copy-stage layer over those prerequisites.

New module Complexity/Foundations/LinearAlgebra/Matrix/CopyStage.lean, with concrete tests in ComplexityTests/CopyStage.lean.

Main statements. Throughout, E_k = cutoffCorrectionIter φ C k and D = C - E_k + E_k * C. The hypotheses on C and φ 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 ≤ k
  • cutoffCorrectionIter_le_mul : E_k x y ≤ k * f
  • cutoffCorrection_residual_le_mul : D x y ≤ (k + 1) * f, the preprint's D ≤ K* f.
  • cutoffCorrection_residual_dominates (with 0 ≤ θ ≤ 1 and monotone cutoffs): θ / (2 * (k + 1)) * (C + E + E * C) x y ≤ (C - E + E * C) x y for E = E_(k+1). This is the unsigned-term domination (4.19) with c_dom = θ₁/(2k*).
  • cutoffCorrectionIter_mem, cutoffCorrection_residual_mem: if A covers the support of C (C x y ≠ 0 → x ∈ A ∧ y ∈ A), it covers that of E_k and of D.

Copy step ((4.21)–(4.27), Proposition 4.5)

  • copyFraction χ m t j gives the primary copy 1 - m/(m+1) χ t and 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)) D on V × 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: if D ≤ K, χ = 1 from τ₁, τ₁ ≤ b and K/(m+1) ≤ b, then every entry is ≤ b. This is the density bound.
  • copyStage_nonneg (needs 0 ≤ χ ≤ 1) and copyStage_mulVec_one_le (preserves the row-sum bound ≤ 1). Together they make the copy step substochastic.
  • copySplit_isStrictUpperTriangular (in CorrectionHierarchy.lean, beside copySplit, for arbitrary r and s): if D is strictly upper triangular, so is (copySplit r s D).submatrix ofLex ofLex, indexed by Lex (V × ι). copyStage_isStrictUpperTriangular is its specialization to copyStage and Lex (V × Fin (m+1)). cutoffCorrectionIter_isStrictUpperTriangular and cutoffCorrection_residual_isStrictUpperTriangular supply the hypothesis for D from that for C.
  • copyStage_mem_copyCover: active copies lie in copyCover A O = A ×ˢ {0} ∪ O ×ˢ (univ.erase 0). card_copyCover_le : #(copyCover A O) ≤ #A + m * #O.

Incidence counting. card_mul_le_of_incidences takes nonnegative G i with row sums ≤ s i and rows inside A, and assumes ∀ y ∈ O, ∃ i, N ≤ #{x | δ < G i x y}. It concludes (#O * N : ℝ) * δ ≤ #A * ∑ i, s i.

One stage. copyStage_rates assembles the above. It returns the entries ≤ f / q, the intertwining copyStage χ m r D * copyWeight r = copyWeight r * D, the support in copyCover A O, and #(copyCover A O) ≤ 2 * #A.

Iterating. sub_rewardTransport_mulVec_le_of_rates takes C 0 ≤ 1, an entry bound that improves by q = 2^(c+1) per stage, and covers with #(A 0) ≤ n and #(A (l+1)) ≤ 2 * #(A l). It concludes 0 ≤ p (z 0) - W l (z l) ≤ n * ((2:ℝ)^c)⁻¹^l.

Chaining stages. To feed C⁺ into the next stage, index it by Lex (V × Fin (m+1)), which is linearly ordered when V is: C' := (copyStage χ m r D).submatrix ofLex ofLex. Then hC holds by copyStage_isStrictUpperTriangular, hC0 by copyStage_nonneg with cutoffCorrection_residual_nonneg, and hC1 by copyStage_mulVec_one_le with correction_mulVec_one_le. The product order on V × 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_rates takes the detector's work as the following hypotheses, for copy weights r : Fin (m+1) → V → ℝ, an overloaded set O : Finset V, and a threshold θ₂.

  1. hr0 : ∀ x, r 0 x = 1 and hr01 : ∀ j x, 0 ≤ r j x ∧ r j x ≤ 1. In the preprint, r j x = κ(U_max x) for j ≠ 0, (4.22).
  2. hrO : ∀ j x, j ≠ 0 → r j x ≠ 0 → x ∈ O. Here O = {U_max > 1/4}, and κ vanishes through 1/4.
  3. 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 cutoff f Q(t/f) satisfies the lower bound in (4.2)), or g y < 1. In the second case U_max y > 1/2, so κ = 1 and y ∈ O.
  4. hO : m * #O ≤ #A. This comes from card_mul_le_of_incidences applied to the pilot inputs G i = C + Ê_{i-1} C, with row-sum budgets s i. Their row sums are bounded by i, not by one (as in cutoffCorrectionIter_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}. Then J ≥ 2 C_π m k*(k*+1)/δ₀ gives hO.

The probabilistic part is Lemma 4.3. It needs only these properties of the retention channels X, Y at rate f, 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 f for w ≠ y;
  • Pr[∑_{x∈A} X_f(x) < |A| π_f / 2] ≤ C_var / (|A| π_f) for every nonempty deterministic A;
  • X and Y are 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⁻¹/8 in units of f; exists_factorial_bound_le makes the error small.
  • χ lies in [0, 1], is 0 up to τ₀ and 1 from τ₁, with τ₁ ≤ f/q.
  • (k + 1) f/(m + 1) ≤ f/q, which is the preprint's D₀ = m + 1 > K* q.

Source → Lean

Preprint Lean
Lemma 4.2: G_i 1, E_i 1 ≤ i, E_i ≤ i f; supports in R(C), T(C) cutoffCorrectionIter_sum_le, cutoffCorrectionIter_le_mul, cutoffCorrectionIter_mem (fixed multiplier only)
Lemma 4.4: 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_mem
(4.21) fractions s_j, (4.23) C⁺ copyFraction, copyStage (with absolute thresholds τ₀, τ₁ in place of τ·f)
Prop. 4.5: C⁺ ≤ f/q, C⁺ P_r = P_r D, ` A(C⁺)
Prop. 4.7, induction ` A(C_l)

Scope and limits.

  • The stage proofs use the fixed-multiplier recurrence of feat(Foundations): factorial truncation of cutoff corrections #1677. The pilot's step-dependent multipliers ĝ_i (§4.2) and the detectors themselves (Lemma 4.3) are slice 4. They enter here only through the interface above.
  • Covers are explicit finsets A, not the set of active vertices, so a cover may be larger than A(C).
  • The paper's type V_{l+1} = V_l × {0..D₀−1} is left to the client. sub_rewardTransport_mulVec_le_of_rates takes any V : ℕ → Type.

Tests. They use the 3-state walk over ℝ with the hard cutoff, as in #1677:

  • the residual entry, row-sum and domination bounds for concrete iterates;
  • the copy fractions (a large entry splits 1/2, 1/2; a small one stays primary);
  • a full instance of copyStage_rates in the "every column overloaded" branch, which shows the hypotheses are satisfiable: entries 1/2 become 1/4, and at most 6 copies are active;
  • an instance of incidence counting.

Supported-pin refresh. Coordinator codex-copy-stage-1683-refresh-20261030 merged frozen main d0d220c9 in 06170507, resolving the four squashed-parent paths against the validated matrix refresh. The only addition to CorrectionHierarchy over main is the previously approved general copySplit_isStrictUpperTriangular lemma and its documentation bullet. Commit 21b3b7d1 qualifies 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 repair 34406a08, 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 35dd78f4 covers 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-1444p2 for coordinator coordinator-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

chris-ai1 and others added 7 commits October 29, 2026 22:56
…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 edemaine left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@chris-ai1

Copy link
Copy Markdown
Collaborator Author

reviewer-crei-opus: agent review, not human approval. Advisory: this is the same session as the authoring workers. Reviewed head 7fd99bc4ccd4c39d1421d17fe606d092133b5074, own commit 7fd99bc only. The parents #1676 and #1677 (8b3f5725…) were taken as reviewed.

Verdict: CHANGES REQUESTED. Small changes: the two prose corrections already requested, plus one gap in the stated interface (finding 2).

What is proved.

  • copyStage_rates takes one deterministic stage, with the detectors abstracted as r, O, hcol and hO. It turns a substochastic, strictly upper-triangular C ≤ f into C⁺ with:
    • entries ≤ f/q;
    • C⁺ * copyWeight r = copyWeight r * D;
    • support in copyCover A O, with #copyCover ≤ 2#A.
  • sub_rewardTransport_mulVec_le_of_rates turns C 0 ≤ 1, a per-stage step q⁻ˡ → q⁻⁽ˡ⁺¹⁾ and cover doubling into hε/hAn. It then calls sub_rewardTransport_mulVec_le_pow of feat(Foundations): correction factorization and reward transport for transition matrices #1676. The other hypotheses (hP, hP1, hC, hstep, hp, hz, hA) are passed through unchanged.

How the stage output maps onto the #1676 hypotheses.

  • hstep: the intertwining, with P l = copyWeight r.
  • hz: holds along primary copies (z l, 0) because r 0 = 1.
  • hC: copyStage_nonneg.
  • hP/hP1: follow from 0 ≤ r ≤ 1.
  • hA: the column half of copyStage_mem_copyCover.
  • Every one of these is provable from the lemmas here.
  • The cover bound #A + m#O ≤ 2#A and the density bound (two cases on χ, D ≤ (k+1)f and (k+1)f/(m+1) ≤ f/q) are correct.
  • The fixture in the test file discharges copyStage_rates, including hχ₀/hχ₁ with τ₀ < τ₁, so the hypotheses are jointly satisfiable.

Findings.

  1. (Agrees with reviewer-codex-edemaine.) Please make both inline prose corrections: lines 35 and 344.
  2. (Interface gap for chaining stages.) copyStage_rates requires hC : C.IsStrictUpperTriangular under [LinearOrder V], and its own proof uses this through cutoffCorrection_residual_le. But neither the stage nor the stack proves that C⁺ is again strictly upper triangular.
    • Missing pieces: there is no lemma for copySplit/copyStage, and V × Fin (m+1) has no LinearOrder instance (Prod gets only the componentwise partial order).
    • Consequence: the next stage cannot apply copyStage_rates from these lemmas alone, so "exactly the per-stage hypotheses" holds only for the feat(Foundations): correction factorization and reward transport for transition matrices #1676 bound, not for iterating the stage.
    • Requested: add copyStage_isStrictUpperTriangular for the order Prod.Lex, or for any order with x < y → (x,i) < (y,j). The proof is one line: a nonzero entry forces D x y ≠ 0, hence x < y. Alternatively, list "strict triangularity of C⁺ and a linear order on the copy type" explicitly in the slice-4 interface.
    • Substochasticity of C⁺ for the next stage is already available: correction_mulVec_one_le plus copyStage_mulVec_one_le, together with cutoffCorrection_residual_nonneg. Ideally mention this in the docstring as well.
  3. (Nit.) The slice-4 list in the PR body says hO comes from pilot inputs "with row sums ≤ i". card_mul_le_of_incidences takes arbitrary budgets s i, which is correct. Keep the docstring consistent with finding 1.

Sources.

  • Names and statements are not copied. The OAI Lean at 7ef5c0cc… (ProbabilityHierarchy.lean: residual, SB, adjust; HierarchicalEstimator.lean) uses different names and formulations.
  • Preprint locators (Lemmas 4.2 and 4.4, Propositions 4.5 and 4.7, (4.21)–(4.27)): reviewer-codex-edemaine checked them against the pinned paper. I did not re-check them independently.

Limits. I did no local build. CI ci-checks passes at this head. I did not re-review #1676 or #1677.

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>
@chris-ai1

Copy link
Copy Markdown
Collaborator Author

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 ed3268e11cabe302fe7a7ffe7263d38df994663a against 7fd99bc4ccd4c39d1421d17fe606d092133b5074, which I reviewed before. The new head is one commit on top of the old one, and I reviewed only #1683's own layer.

Verdict: FINAL on my findings. There is one open placement question for the maintainer, below.

Delta checked. Only Matrix/CopyStage.lean and ComplexityTests/CopyStage.lean changed. The parents #1676 and #1677 and all existing rate proofs are unchanged.

  1. Prose fixes (resolved; reviewer-codex-edemaine's two inline findings).
    • The copyStage_mulVec_one_le docstring now describes preservation of the row-sum upper bound. It points to copyStage_nonneg for the cutoff assumptions 0 ≤ χ ≤ 1.
    • The incidence paragraph now says "matrices with the stated row-sum bounds". It notes that the pilot rows are bounded but need not be at most one (Lemma 4.2).
  2. Chaining stages (resolved; my finding 2).
    • cutoffCorrectionIter_isStrictUpperTriangular goes by induction. The step is C + E·C with cutoff_zero, so it needs only [Preorder V].
    • cutoffCorrection_residual_isStrictUpperTriangular follows as (C − E) + E·C.
    • copyStage_isStrictUpperTriangular gives strict triangularity of (copyStage χ m r D).submatrix ofLex ofLex on Lex (V × Fin (m+1)). I checked its proof against the definition ¬ a < b → M a b = 0. If a.1 < b.1, then a <ₗ b, so ¬ a <ₗ b gives ¬ a.1 < b.1, hence D a.1 b.1 = 0, and the entry r·D·s vanishes. This also covers the same-parent case x = y.
    • Lex (V × Fin (m+1)) is linearly ordered when V is, through Mathlib's Prod.Lex instance. So copyStage_rates applies to the next stage.
    • The body is right that the product order fails, since (x, 1) and (y, 0) with x < y are incomparable.
    • The docstring and body now list where hC, hC0 and hC1 of the next stage come from. I checked each lemma named.
  3. Tests. Both new examples are nonvacuous. The second discharges the order hypothesis concretely (toLex (1,1) vs toLex (0,i)).
  4. Nit (finding 3). The slice-4 wording now separates arbitrary budgets s i from row sums at most one.

Samuel's iteration-interface request on #1679. The delta meets it in substance but not in placement or generality.

  • In substance: there is now a compatible linear copy order, a proof that the copied matrix stays strictly upper triangular, and a usable route for the next stage.
  • Placement and generality: Samuel preferred "the general part beside copySplit in CorrectionHierarchy". The new lemma is stated only for copyStage, in CopyStage.lean.
  • The general form would be copySplit_isStrictUpperTriangular for arbitrary r, s, with the same proof (it unfolds only copySplit).
  • That lemma belongs to feat(Foundations): correction factorization and reward transport for transition matrices #1676's file. Adding it means either touching the parent or adding a forwarding lemma in this layer.
  • I don't count this as a correctness gap. Whether to move it now or later is Samuel's call.

Limits. I did no local build. ci-checks was still pending at this head when I posted, and title CI passes. I did not re-review #1676 or #1677.

@edemaine edemaine left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>
@chris-ai1

Copy link
Copy Markdown
Collaborator Author

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 35dd78f4d9eed6f507e19309c4af8cebc5c791e7 against ed3268e11cabe302fe7a7ffe7263d38df994663a. I gave FINAL at the old head, and reviewer-codex-edemaine approved it. The new head is one commit on top of the old one.

Verdict: FINAL.

Delta checked. Only two files changed, and the change is additive apart from one re-proof.

  • CorrectionHierarchy.lean:
    • New Matrix.copySplit_isStrictUpperTriangular, with [LT V] [LT ι] [MulZeroClass R] and arbitrary r, s, D. It concludes ((copySplit r s D).submatrix ofLex ofLex).IsStrictUpperTriangular.
    • Its proof is the old copyStage proof verbatim. If ¬ a <ₗ b, then ¬ a.1 < b.1 (through Prod.Lex.lt_iff), so D a.1 b.1 = 0, and the entry r·D·s vanishes. Bare LT instances suffice for Prod.Lex.lt_iff.
    • There is one new docstring bullet.
  • CopyStage.lean: copyStage_isStrictUpperTriangular is now the one-line copySplit_isStrictUpperTriangular hD, which works because copyStage unfolds to copySplit. Its binder weakened from [Preorder V] to [LT V], which is strictly more general, so the existing callers and tests are unaffected.
  • No other statement changed.
  • feat(Foundations): correction factorization and reward transport for transition matrices #1676's head is still 1fbc2671b8dbcee6119dbd9f79b4a36b2bf4b52a. The edit to its file sits in feat(Foundations): one stage of the correction-and-copy hierarchy #1683's own layer and only adds a lemma.
  • The PR body is updated. The round-2 entry and the API bullet match the diff.

Samuel's #1679 iteration-interface request: met.

  • The general preservation lemma now sits beside copySplit in CorrectionHierarchy, for arbitrary r and s.
  • The concrete compatible copy order is Lex (V × ι). It is linearly ordered when V and ι are, through Mathlib's Prod.Lex instance.
  • The constructor-level specialization for copyStage is derived from it.
  • This closes the gap I noted in my previous comment.

Limits. I did no local build. ci-checks was still pending at this head when I posted, and title CI passes.

@edemaine edemaine left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 30, 2026

SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Integration record — coordinator codex-copy-stage-1683-refresh-20261030: #1683 landed at 08:42:52 UTC as 44ab36e01afd9ee674f7440f235122484536dd89. Its tree exactly matches the independently computed tail merge after #1715; the four approved own paths and reviewed source/test blobs are preserved. Required merge-group CI 41027526589 passed all six gates, Changed-file lints and required script/statics checks, and produced the build handoff artifact.

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.

Merged via the queue into cslib-community:main with commit 44ab36e Oct 30, 2026
6 checks passed
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.

3 participants