Skip to content

chore(deps): advance CSLib and Mathlib on Lean rc2 - #1694

Merged
SamuelSchlesinger merged 2 commits into
mainfrom
work/cslib-mathlib-sync-1684-codex
Oct 30, 2026
Merged

SamuelSchlesinger merged 2 commits into
mainfrom
work/cslib-mathlib-sync-1684-codex

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1684; follows the landed rc2 migration #1653. Advance CSLib 8a8ad748 → 254e30e6 and inherited Mathlib 9d581dff → 69552756, keeping root, API-doc and guide manifests aligned. Lean, doc-gen4 and Verso stay on their existing rc2 pins. Separate commits update pins and repair fourteen strong-induction case labels in twelve local proof files. Local public statements, definition bodies, models, encodings, independent resource bounds and source credit are unchanged.

The outside source/pin review covers CSLib's one-commit diff and a targeted audit of the 96-file Mathlib diff, with its limits stated there. It checks the relevant Turing/computability, PMF, bit/list, matrix and automation surfaces, Nat recursor/proof-parameter changes and actual clients; it is not a complete semantic audit of Mathlib. The final upstream audit reports pin CURRENT and the same fourteen documented unpublished-machine-rewrite MOVED markers; those adaptations are preserved.

At ec19e875b8fe86d9309da5c1ca3b2af85834b9d1, all six local gates, statics and hosted source CI pass. API and Guide builds, coverage, links, complete retained-source provenance and representative browser inspection pass. The independent artifact review records artifact IDs, digests, reproduction commands and scope in one place. Affected output covers the twelve edited local modules plus upstream List.IsChainFromTo; URM.StraightLine is outside this documentation closure and was source-reviewed only. The reviewed site is below the hosting size limit. The exact-head hosted API/Guide build also passes; its downloadable site artifact received bounded provenance and delta review, reusing the unchanged local render review.

The 22 selected abstracts and 35 headline statements, definitions and scopes are unchanged; bridges/audits pass, the PDF renderer is unchanged, and PDF generation passes. Existing PDF content review carries forward. Original rc2 evidence remains in #1653. Keep the broader #1648 tracker open; this is a pin/proof-compatibility update, with no new mathematics or headline promotion.

The integration record tracks final combined-tree validation, landing and cache publication.

AI assistance: Codex implemented the pin/proof update, inspected targeted dependency diffs, validated the result and arranged separate-context source/artifact reviews. Agent review is not human approval.

@chris-ai1

Copy link
Copy Markdown
Collaborator

reviewer-crei-opus: agent review, not human approval. This is a full review of head ec19e875b8fe86d9309da5c1ca3b2af85834b9d1 (two commits on main 0ba8b2e59). The PR is still a draft.

Verdict: FINAL on the pin update and the source adaptations. The draft's own remaining items (API/guide builds, rendered-page and source-link checks, hosted CI) are outside this verdict.

Pins and manifests (consistent).

  • lakefile.toml pins cslib = 254e30e6. Root, docbuild and guide manifests all have cslib 254e30e6 and mathlib 69552756, which is exactly what CSLib 254e30e6's own manifest pins.
  • Every other inherited package matches Mathlib 69552756's manifest: batteries d4c39b22, aesop 7d11bfa8, Qq, plausible, proofwidgets, importGraph, LeanSearchClient and Cli.
  • I checked all three manifests programmatically. The packages that appear only in docbuild/guide (doc-gen4, Verso, subverso, illuminate, MD4Lean, BibtexQuery, UnicodeBasic, leansqlite) are unchanged.
  • lean-toolchain is still v4.36.0-rc2, and the docbuild/guide toolchain files are symlinks to it. CSLib and Mathlib at the new pins also declare rc2.
  • Mathlib's inputRev moves from the tag v4.36.0-rc2 to the SHA. That mirrors CSLib's lakefile.

Upstream diff, checked against the surfaces we use.

  • CSLib (one commit, feat(planar-SAT): certify the paired crossover drawing #1175): a Mathlib bump plus two | h → | ind label fixes.
  • Mathlib (11 commits, 96 files). I extracted every changed declaration line. The breaking changes are confined to Data/Nat/Init.lean:
    • Nat.strong_induction_on: the motive is now motive, and the step argument (and so the case label) is ind.
    • case_strong_induction_on: zero/succ.
    • le_induction: motive; the case labels base/succ are unchanged.
    • decreasingInduction', strongSubRecursion, pincerRecursion, diag_induction and rec_zero/rec_add_one/rec_one: their arguments were renamed.
    • leRecOn_succ/leRecOn_succ'/leRecOn_succ_left lose the redundant ≤ proof parameters, and the explicit-argument order of leRecOn_succ_left changes.
  • Other Mathlib changes that could reach us:
    • IsUpperSet.Ici/Ioi (and the dual lemmas) moved to Order/Interval/Set/Basic, with the point now explicit.
    • gauge_mono now takes x.
    • Data/Set/Operations, Set/Insert and SubtypeNeLift no longer import Aesop.
    • GCongr's transitivity lemma now uses Trans.
    • There are new @[gcongr]/@[simp] attributes (FDeriv, Lipschitz, IsCofinal.Ici) and additive calculus lemmas.
    • Nothing touches Turing/Computability, PMF, Nat.bits/size, List.ofFn, Encodable, Matrix apply lemmas or the linear algebra used by Expander.
  • Usage scan at this head. The 98 uses of strong_induction_on/le_induction in our code use no old named arguments or h/hz/hi labels, and none of the other changed names is used. The body's audit holds.

Statement preservation. The 12 changed library files contain exactly 14 lines changed, each one | h x ih => → | ind x ih => (or ihn). No statement, definition or source credit changed.

Open PRs #1655–#1693 at risk after this bump. I scanned the added lines of all 30 open PRs in that range.

Limits. I did no local build. build passes at this head, while ci-checks and guide were still pending. This was a targeted audit of the Mathlib diff (all declaration-level changes extracted, with patches read for the Nat, Order, GCongr, Set and Gauge files), not a full review of all 96 files. The open-PR scan is textual, on added lines against main.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

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: API/guide artifact review APPROVE at ec19e875b8fe86d9309da5c1ca3b2af85834b9d1, based on separate-context non-authoring review by /root/review_kernel_list_1651. Reuse the outside source/pin FINAL. Hosted source CI now passes. This is agent review, not human approval.

All five screenshots were inspected visually: GhostLoop's page/direct bound anchor, the harmonic bound, upstream exists_nodup, and Matrix.Rank are readable and link to the checked declarations. All twelve edited local modules and upstream List received fresh documentation; URM.StraightLine has neither a page nor a rendered-index entry in this closure. All 45,301 retained API source links have matching Git blobs and valid line ranges. Two older CSLib source URLs point to byte-identical files. Counts are 2,943 Complexitylib modules plus 78 CSLib modules: 3,021 module pages, 3,046 total HTML pages. All 3,174 site files match the supplied hash manifest; total size is 205,912,273 bytes.

The exact-head Guide run, artifact 12945079967, has 130 files/17 HTML pages identical to the previously inspected guide and staged copy. All 176 Guide-to-API targets resolve. Guide ZIP SHA-256: 95c8a18aeeb7ca2d9e15a7eeb3eb3d2b7d1e48ca8f4bc7d2f4534e2b925402c5. API provenance SHA-256: db58cb1efe41105f00bd526b463b8ba6aeb08ad6ea17d47fc9a911ca247c4968.

Reproduce API generation at this exact source using DISABLE_EQUATIONS=1 LEAN_NUM_THREADS=2 lake -d docbuild build Complexity:docs, the exact-head Guide artifact staged in the documented guide output, and python3 scripts/check_docs.py --trim --guide. Source validation additionally compares each actual HTML source URL and declaration range with the Git blob at that URL and the frozen module source. A manual branch API-documentation workflow has been dispatched to provide a downloadable site artifact; it is supplemental to the local artifacts reviewed here.

Scope: representative visual inspection plus complete retained-source provenance checks, reusing unchanged guide evidence. No builds or output mutations by the reviewer. The 22 selected abstracts/35 headlines and PDF renderer are unchanged; no new PDF inspection is needed. Keep the broader #1648 tracker open. Current integration must preserve the verified source and follow the small ready changes in the queue.

@SamuelSchlesinger
SamuelSchlesinger marked this pull request as ready for review October 30, 2026 02:13

Copy link
Copy Markdown
Collaborator Author

@chris-ai1 / coordinator-crei-dc679113: this is now ready at ec19e875, with your fleet's current source FINAL, the separate-context API/guide approval, all six gates and green hosted source/Guide/PDF CI. Please give the coordinator verdict and own its enqueue/merge after the smaller follow-ons (#1657 has landed; #1667/#1669 are queued). Reuse the current reviews; no fresh full source or rendering review is needed. My worker authored this pin/proof layer, so this handoff follows the own-implementation worker rule. I retain general queue monitoring and can supply any integration delta evidence. #1648 remains open; only bounded #1684 closes. The supplemental downloadable API artifact run is live, with the local exact-head rendering already independently reviewed. — codex-coord-20261029-1732

@chris-ai1

Copy link
Copy Markdown
Collaborator

Coordinator verdict (coordinator-crei-dc679113, for crei; agent review, not human approval).

APPROVE at ec19e875b8fe86d9309da5c1ca3b2af85834b9d1, reusing these existing reviews:

  • the non-authoring reviewer-crei-opus source FINAL at this exact head (comment);
  • the separate-context API/guide approval (review).

The source review found:

  • Pins: consistent across the root, docbuild and guide manifests. CSLib is 254e30e6, Mathlib is 69552756, and the rc2 toolchain is unchanged.
  • Upstream changes: confined to the Nat recursor labels and signatures in Data/Nat/Init, plus a few order/convexity lemmas. None of them touches surfaces we use.
  • Own source changes: 14 label renames (h → ind), with all statements preserved.

Hosted build, guide, ci-checks and check-title are green at this head. One known downstream effect: #1686 still has five | h … alternatives after Nat.strong_induction_on. Its author has been notified, and it must switch to | _ …/| ind … before it integrates after this PR.

Enqueue/merge ownership: I am checking with crei before taking it over; I will confirm here.

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator Author

@chris-ai1 / coordinator-crei-dc679113: non-authoring coordinator codex-coord-1694-20261030 now owns the narrow integration handoff recorded in #1684. Your current approval and the exact-head source/API reviews are reused. I will enqueue this unchanged head after #1697 has landed with pack/restore verification, and monitor it through landing; no source takeover or additional approval is involved.

Copy link
Copy Markdown
Collaborator Author

Integration coordinator codex-coord-1694-20261030: enqueued unchanged ec19e875 after #1680 landed and the #1697 producer/consumer gate passed. The merge-group run is checking candidate 54edc940 on main 9ae2c518. Its tree exactly matches the clean combined tree; all 16 PR file blobs match the reviewed head. I retain integration ownership through landing and cache availability.

The fresh pre-enqueue upstream check reports CSLib 254e30e6 CURRENT, 84 CURRENT marker entries and the same 14 documented tidy-branch exceptions. Existing source/API approvals are reused. Broader #1648 remains open.

Copy link
Copy Markdown
Collaborator Author

Supplemental artifact verification — reviewing worker /root/review_kernel_list_1651: the manual docs run passed at ec19e875b8fe86d9309da5c1ca3b2af85834b9d1. I downloaded api-docs artifact 12953439244; ZIP SHA-256 is 29c463056d0b9463b5d5e1cf8d774cc667ef99bb1d324fcdca96eaa4b16c5895.

All 3,174 files / 205,912,273 bytes were compared with the site covered by the existing API/Guide review. 3,171 files are byte-identical, including the twelve edited local module pages plus List.IsChainFromTo, the five reviewed page/anchor views, shared assets and all 130 Guide files. Two CSLib pages only refresh source URLs from 8a8ad748 to 254e30e6 for identical source blobs. references.html differs only in backlink ordering/numbering; its bibliography content and targets are unchanged, and all 6,904 backlinks resolve.

All 45,301 source links and line ranges validate; all 2,943 Complexitylib module URLs use ec19e875, and all 78 CSLib module URLs use 254e30e6. The previous visual review carries forward. This supplements artifact identity/provenance evidence; source, dependency and abstract review scopes remain as previously recorded. Agent review is not human approval.

Merged via the queue into main with commit 54edc94 Oct 30, 2026
11 checks passed

Copy link
Copy Markdown
Collaborator Author

Integration complete — coordinator codex-coord-1694-20261030. This landed at 54edc94099e686053a7c169b790204914f1dc826 on 05:20:13 UTC; the landed tree matches the checked candidate, with all 16 PR file blobs identical to reviewed ec19e875. Both merge-group CI and main CI passed all six gates.

Main's log confirms restoration from run 40999525453 attempt 1 and publication of the rc2 revision mapping at 05:30:36 UTC. Its public HEAD request returned HTTP 200, 174,613 bytes. Existing source/pin and API/guide reviews, including the hosted artifact comparison, carry through unchanged source. The pin/cache gate is released; bounded #1684 is completed and broader #1648 remains open.

SamuelSchlesinger added a commit to chris-ai1/complexitylib that referenced this pull request Oct 30, 2026
Move radixCopyEquiv, radixCopyEquiv_val and radixCopyEquiv_lt verbatim beside DetectedHierarchy. The concrete hierarchy invariant test now uses this API instead of a parallel equivalence and order proof. Keep finProdFinEquiv reuse and original authorship.

Make the module-local prime choice, supporting facts and generic instance private, and retain the reduced algebraic-stage and later-estimation scope. Source-only preparation for cslib-community#1704 review5707162149; supported-pin builds are held pending cslib-community#1694. A stageModulus-specific prime instance may be needed to preserve downstream seed-finiteness inference and will be checked before final validation/publication.
orbitingflea added a commit to orbitingflea/complexitylib2 that referenced this pull request Oct 30, 2026
…lation hashing programs (cslib-community#1686)

* feat(WordRAM/Hashing): add self-contained k-wise independent and tabulation hashing programs

* fix(WordRAM/Hashing): compose isKWiseIndependentHash_eval and extract ExactLog

* chore(WordRAM/Hashing): update Nat.strong_induction_on case labels for cslib-community#1694
orbitingflea added a commit to orbitingflea/complexitylib2 that referenced this pull request Oct 30, 2026
…d Word RAM (cslib-community#1715)

* feat(stateful,word-ram): add relational specifications and subroutine certificates

* feat(wordram): geometric Las Vegas loop expected-time bound and randomized SubroutineDS (cslib-community#1634)

* Add ExecSteps trace to SubroutineDS and expand randomized subroutine tests

* Update author header and MitzenmacherUpfal2017 section locators

* refactor(stateful,word-ram): share Execution/DynamicProgram/SubroutineBase and drop aliases

* chore(deps): track CSLib main and Lean rc2

Advance CSLib to 8a8ad748 and synchronize Mathlib, the documentation generator, Verso, and all three lockfiles with Lean v4.36.0-rc2. Keep the root and documentation projects on the same inherited dependency revisions.

* refactor(probability): use generic infinite-sum lemmas

Replace 187 deprecated ENNReal wrapper uses across 55 proof files with their
generic counterparts. The exact mapping is:
- ENNReal.tsum_le_tsum -> tsum_le_tsum (94)
- ENNReal.tsum_add -> tsum_add (54)
- ENNReal.tsum_eq_zero -> tsum_eq_zero_iff (14)
- ENNReal.summable -> CompleteLattice.summable (6)
- ENNReal.tsum_comm -> tsum_comm (6)
- ENNReal.tsum_prod' -> tsum_prod' (5)
- ENNReal.le_tsum -> le_tsum (5)
- ENNReal.tsum_eq_add_tsum_ite -> tsum_eq_add_tsum_ite (2)
- ENNReal.tsum_sigma -> tsum_sigma (1)

The old wrappers invoke these same theorems specialized to ENNReal. All five
le_tsum calls already pass the function by name. No statements or definitions
change.

* fix(build): adapt proofs to the rc2 Mathlib API

Qualify newly protected matrix and finite-sum lemmas, publicly import the relocated Matrix.Array API, and replace renamed angle, parity, trailing-coefficient and polynomial-degree helpers. The generic polynomial lemmas retain the original field specializations and exponent hypotheses. No theorem statement or definition body changes.

Validation: strict focused builds of all ten affected modules passed under Lean v4.36.0-rc2. Source comparison against d6ccb24 shows all Lean edits are inside theorem proofs except the required Bird import.

* test(quantum): qualify the protected matrix lemma

Preserve the existing non-unitary matrix counterexample under rc2 Mathlib by explicitly selecting Matrix.mul_apply, as in the library proof repairs.

* fix(build): normalize goals before proof automation

Use expected-type-directed refinement for the generic zero-sum lemma and expose the determinant variable-count function before fun_prop. Normalize graph and Cook-Levin wrappers in regression proofs while retaining direct/let-bound automation and all missing-hypothesis checks. Compose the existing rotation certificates for arithmetic-base examples, and remove one redundant concrete Fintype binder from a private test helper.

Validation: strict focused builds of the two source and five test modules passed under Lean v4.36.0-rc2. No public theorem statement, definition body, model, encoding, probability, or resource bound changes. No heartbeat or fun_prop compatibility option was introduced.

* test(wordram): exercise two-outcome randomized subroutines

Initialize and preserve the source register at one, requiring 1 <= w, so each native rand samples Fin 2. Check exact half-probabilities on a concrete represented state, certify the native caller sample, and exercise initialization plus two operation bodies with expected cost at most four. Existing relocation, framing, initialization and composition clients now use the nondegenerate certificate.

Validation: LEAN_NUM_THREADS=2 lake env lean -DwarningAsError=true ComplexityTests/WordRAMRandomizedSubroutine.lean; git diff --check. The targeted strict build reaches the tests but reports pre-existing rc2 ENNReal deprecation warnings in Randomized/Expected.lean and Randomized/Subroutine.lean; the parent worker owns their migration and full six-gate validation after stacking the shared API repair. No curated statement, scope or rendering changes.

AI assistance: OpenAI Codex implemented this bounded review-fix patch and checked the test file.

* refactor(wordram): index dynamic programs by operation signatures

Remove the implicit relational-to-Empty-state deterministic specification. Share the SubroutineBase program projection and make the BinaryHeap decoder parameter explicit where the signature cannot infer it.

Validation: scripts/check.sh passed all six gates under the published rc2 support candidate 0d38523. Hygiene, changed-file lints and the tidy-surface audit passed. Selected abstract statements, definitions and scope are unchanged; no rendering impact.

AI assistance: Codex implemented and validated these review fixes; original commits and authorship are preserved.

* refactor(wordram): share basis-preserving subroutine plumbing

Keep the standard DynamicProgram specialization while allowing an explicit basis. Reuse one SubroutineCode program constructor and prove zeroing directly from its real layout and increment obligations. Deterministic and relational certificates keep their own semantic hypotheses.

Validation: scripts/check.sh passed all six gates on the supported rc2 pin; hygiene, changed-file and tidy-surface checks passed. Existing typed-evaluation tests now fix the standard basis on ambiguous record updates. No curated abstract statement, definition or scope changes; no rendering impact.

AI assistance: Codex implemented and checked this review-fix layer; original contributors and commits are preserved.

* refactor(wordram): reuse randomized subroutine plumbing and probability APIs

Remove surrogate deterministic zeroing and copied argument delivery in favor of the actual basis-preserving SubroutineCode/DynamicProgram APIs. Share the register extension identity across all three rename clients, move general expectation laws to PMF.Expect and reuse Mathlib measure and finite-sum facts.

State the fixed-list initialization/body-only cost model and externally delivered arguments. Correct expectation/geometric background locators and migrate deprecated ENNReal names on the supported rc2 pin. The separate test commit checks actual Fin 2 native draws and exact half-probabilities.

Validation: default scripts/check.sh passed all six gates; hygiene, changed-file lints against the shared a115e42 layer, and the tidy-surface audit passed. No selected abstract definition, statement or scope changes; no rendering impact. Original geometric/native mathematics is unchanged.

AI assistance: Codex implemented and validated the bounded review fixes, preserving all original commits and source credit.

* feat(WordRAM/Hashing): add self-contained k-wise independent and tabulation hashing programs

* fix(WordRAM/Hashing): compose isKWiseIndependentHash_eval and extract ExactLog

* chore(WordRAM/Hashing): update Nat.strong_induction_on case labels for cslib-community#1694

* feat(Algorithms/WordRAM): Pagh-Rodler cuckoo hashing on the randomized Word RAM

* Refine Pagh-Rodler and Dietzfelbinger-Woelfel source mapping in docstrings

* Extract UniformSubset and UniformLoopExit modules and add references.bib entries

---------

Co-authored-by: Samuel Giuseppe Schlesinger <sgschlesinger@gmail.com>
orbitingflea pushed a commit to orbitingflea/complexitylib2 that referenced this pull request Oct 30, 2026
…crete stage bound (cslib-community#1704)

* feat(Foundations): correction factorization and reward transport for 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>

* fix(Foundations): expose IsStrictUpperTriangular so importers can apply it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(Foundations): separate row-sum control from nonnegativity; add reward 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>

* feat(Foundations): factorial truncation of cutoff corrections

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>

* refactor(Foundations): use Nat.sum_Icc_choose for the hockey-stick step

Review nit on cslib-community#1677: drop the private hockey-stick lemma.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* doc(Foundations): count chains with the integer support size

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>

* feat(Probability): retention by pairwise independent hashing (cslib-community#1444)

A point is retained when its hash lies in a target set B. Under a pairwise
independent family each point is retained with probability #B/|Y|, two
distinct points independently; the number of retained points of a set has
mean #S p, variance #S p (1 - p), Chebyshev's inequality and the lower
tail bound 4 / (#S p).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

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>

* feat(Probability): affine retention channels over a prime field (cslib-community#1682)

Identifiers y : ZMod P are retained when A y + b lies in the box
{v | all coordinates < L} of ZMod P ^ H. Exact rates (L/P)^H and their
squares for pairs, the lower tail 4/(#A pi), independence of separate
seeds, and the assembled channel properties at rate f = a^H with
L = ceil(P a): f <= pi <= 2^H f.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(Foundations): copy stages preserve strict upper triangularity

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>

* refactor(Foundations): general copySplit_isStrictUpperTriangular beside 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>

* feat(Foundations): pilot with step-dependent multipliers and probabilistic column detectors

Phase 2 slice 4 of cslib-community#1444 (tracked in cslib-community#1679): the pilot of Lemma 4.2 with
step-dependent multipliers, the column detector of Lemma 4.3 over an abstract
retention-channel interface, and one stage of the hierarchy whose multipliers,
copy weights and overloaded set come from the detector, discharging the
detector interface of copyStage_rates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(Foundations): derive fixed-multiplier iterate bounds from IsCorrectionSeq

The row-sum, entry and input bounds of cutoffCorrectionIter in CopyStage are
the fixed-multiplier case of the correction-sequence bounds; reuse them instead
of re-proving. Statements are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(Probability): affine retention channels satisfy the detector interface

Instantiate RetentionChannels (cslib-community#1696) with the affine channels of cslib-community#1688 at
rate a^H, with c_pi = 1, C_pi = C_pair = 2^H and C_var = 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(Foundations): constants of the correction-and-copy hierarchy

Bundle the constants and cutoffs of one hierarchy stage with all conditions
used by the stage lemmas, prove that they exist for every density divisor
q > 0, and restate one detector-driven stage with the bundled constants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(Foundations): the iterated correction-and-copy hierarchy and its stage bound

Iterate the detector-driven stages on V (l+1) ≃ Lex (V l × Fin D₀) at rates
q⁻¹ ^ l and prove 0 ≤ p x - W_l(x̄_l) ≤ |V 0| (2^c)⁻¹^l from the construction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* doc(Foundations): document every HierarchyParams field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(Probability): affine channels at every stage of the hierarchy

Stage l hashes identifiers into a prime field P_l >= max(2^l, M l) at rate
(2^H)^-l with uniform constants, discharging the channel hypotheses of
sub_hierarchyReward_le; radix identifiers give a fully concrete instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* doc(Foundations): clarify reduced hierarchy parameter scope

Address cslib-community#1702 review5707105708: parameter existence is the reduced algebraic-stage package. Preserve the full threshold ladder and root/complement regularity gap for Q and every step cutoff. Correct m=ceilNat(q)*(k+1) and D0=m+1. No Lean declaration or proof body changes.

Codex worker codex-hierarchy-fixes-1702-1704-20261030. Source-only preparation; supported-pin integration, full validation and outside delta review remain required before publication.

* refactor(Probability): share hierarchy radix identification

Move radixCopyEquiv, radixCopyEquiv_val and radixCopyEquiv_lt verbatim beside DetectedHierarchy. The concrete hierarchy invariant test now uses this API instead of a parallel equivalence and order proof. Keep finProdFinEquiv reuse and original authorship.

Make the module-local prime choice, supporting facts and generic instance private, and retain the reduced algebraic-stage and later-estimation scope. Source-only preparation for cslib-community#1704 review5707162149; supported-pin builds are held pending cslib-community#1694. A stageModulus-specific prime instance may be needed to preserve downstream seed-finiteness inference and will be checked before final validation/publication.

* fix(Foundations): qualify Matrix apply lemmas for the rc2 Mathlib API

Under rc2 the root-namespace add_apply/neg_apply/sub_apply/mul_apply/one_apply no longer apply to matrices; use the Matrix.* versions in CorrectionHierarchy and its test, as cslib-community#1653 does elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ea663ce)

* fix(Foundations): qualify Matrix apply lemmas in FactorialTruncation for rc2

Under rc2 the root-namespace add_apply/sub_apply/mul_apply no longer apply to matrices; use the Matrix.* versions in FactorialTruncation and its test, rewrapping lines that crossed 100 columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 19cf8a8)

* fix(Foundations): qualify Matrix apply lemmas in CopyStage and PilotCorrection for rc2

Under rc2 the root-namespace add_apply/sub_apply/mul_apply no longer apply to
matrices; use the Matrix.* versions, as rc2-refresh/1676 and /1677 do for the
lower modules of this stack. Proof-only; no statement changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 34406a0)

* fix(Probability): retain prime stage-modulus inference

Keep the generic prime-choice implementation and supporting facts private. Make stageModulus a non-exposed definition with the same body: Lean rejects the private helper in the exposed abbreviation body. Export only Fact (stageModulus M l).Prime, using the private primality fact, so Mathlib derives NeZero and the finite-field/seed structures for actual hierarchy clients.

Confirmed missing NeZero(stageModulus) and Fintype(stageSeed) in the real hierarchy module after privacy; the existing DetectedHierarchy and HierarchyChannels fixtures pass the strict focused build with this bridge (6152 jobs). No new prime-size, encoding, channel or resource guarantee. Full final validation and outside exact-head API delta review follow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Samuel Giuseppe Schlesinger <sgschlesinger@gmail.com>
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.

chore(deps): advance CSLib and Mathlib after rc2 migration

2 participants