Skip to content

feat(Expander): spectral gap of box products of permutation multigraphs - #1693

Merged
SamuelSchlesinger merged 8 commits into
cslib-community:mainfrom
chris-ai1:feat/box-product-poincare-1444
Oct 31, 2026
Merged

SamuelSchlesinger merged 8 commits into
cslib-community:mainfrom
chris-ai1:feat/box-product-poincare-1444

Conversation

@chris-ai1

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

Copy link
Copy Markdown
Collaborator

Part of #1682 (Phase 3 of #1444). This adds the product walk over components from the proof of Lemma 6.2 (gap γ/J for J components), stated through the Expander permutation-multigraph API. It is new Foundations mathematics for the library. The underlying fact, tensorization of the spectral gap for product chains, is standard.

Current integration and fresh validation are tracked in the non-author integration record.

Builds on landed #1678. This uses its expect_mul_walk_ofPerms and secondEigenvalue_ofPerms_le in Expander/Perm.lean, its OpenAI2026LogSpace bibliography entry and its shear-translation gap. The BoxProduct layer remains independent of #1691 and #1695.

Main statements (Complexity/Foundations/Combinatorics/Expander/BoxProduct.lean, 184 lines, namespace Cslib.RotationMap):

def boxProdPerms (σ : K → Equiv.Perm V) (τ : K' → Equiv.Perm W) : K ⊕ K' → Equiv.Perm (V × W)
  -- inl k ↦ (σ k) × id,  inr k ↦ id × (τ k)
theorem mul_expect_sq_le_boxProdPerms {c : ℝ}
    (hσ : ∀ f : V → ℝ, 𝔼 v, f v = 0 → c * 𝔼 v, f v ^ 2 ≤ ∑ k, 𝔼 v, (f (σ k v) - f v) ^ 2)
    (hτ : ∀ g : W → ℝ, 𝔼 w, g w = 0 → c * 𝔼 w, g w ^ 2 ≤ ∑ k, 𝔼 w, (g (τ k w) - g w) ^ 2)
    (f : V × W → ℝ) (hf : 𝔼 p, f p = 0) :
    c * 𝔼 p, f p ^ 2 ≤ ∑ k, 𝔼 p, (f (boxProdPerms σ τ k p) - f p) ^ 2
theorem secondEigenvalue_ofPerms_boxProdPerms_le [Nonempty K] [Nonempty K'] :
    (ofPerms (boxProdPerms σ τ)).secondEigenvalue ≤
      1 - min (|K| * (1 - (ofPerms σ).secondEigenvalue)) (|K'| * (1 - (ofPerms τ).secondEigenvalue)) /
        (|K| + |K'|)
theorem spectralExpansion_lazy_ofPerms_boxProdPerms_le [Nonempty K] [Nonempty K'] :
    (ofPerms (boxProdPerms σ τ)).lazy.spectralExpansion ≤ 1 - min (…) (…) / (2 * (|K| + |K'|))

(|K| stands for Fintype.card K.) There are no other hypotheses: c may be any real number, and V, W may be empty or trivial. For factors of equal degree and gap γ, one product has gap γ/2. Iterating gives γ/J for J factors: (A □ B) □ C has weights 2m : m, so its gap is min(2m·γ/2, m·γ)/(3m) = γ/3.

Proof. Write g v = 𝔼 w, f (v, w). Then 𝔼 f² = 𝔼 g² + 𝔼_v 𝔼_w (f − g)², using the existing Fintype.expect_add_sq_of_expect_fiber_eq_zero. Apply τ's inequality on each fiber, and σ's inequality to g. Jensen (sq_expect_le_expect_sq) gives (g(σv) − g v)² ≤ 𝔼_w (f(σv,w) − f(v,w))². For the eigenvalue form, the Dirichlet identity expect_mul_walk_ofPerms turns λ₂(σ) into the Poincaré constant 2|K|(1 − λ₂(σ)).

Source → Lean ([OpenAI2026LogSpace], rev 7ef5c0cc; I read only the paper text, no OAI Lean code):

Preprint Lean
Proof of Lemma 6.2, p. 31: "Apply the lazy walk from Lemma 6.1 to a uniformly selected component. If there are J_comp components and the single-component gap is at least γ_H, the product walk has gap at least γ_H/J_comp." boxProdPerms (component selected with probability proportional to its number of moves, uniform for equal degrees), mul_expect_sq_le_boxProdPerms, secondEigenvalue_ofPerms_boxProdPerms_le, spectralExpansion_lazy_ofPerms_boxProdPerms_le (two factors; iterate for J)

Differences: the statements are ours, and they are binary. The bound is stated for λ₂ of the non-lazy product, and laziness is applied once at the end, not to each component. The preprint's components are the conditioned channels and the free-bit torus. Here a component is any permutation family.

Tests (ComplexityTests/BoxProductExpander.lean, 72 lines):

  • two concrete moves of boxProdPerms (shearTranslationMove 5) (shearTranslationMove 3) by decide;
  • the two-point flip on ZMod 2 satisfies the Poincaré inequality with constant 4, and the theorem transfers it to the square ZMod 2 × ZMod 2;
  • the uniform gap with every hypothesis discharged by feat(Expander): uniform spectral gap for the shear-translation graph on ZMod n × ZMod n #1678: for all n, m ≥ 1, λ((shearTranslation n □ shearTranslation m).lazy) ≤ 1 − 1/16384.

Validation at a9e19a53a: scripts/check.sh (all six gates), python3 scripts/check_hygiene.py --check-simp, python3 scripts/check_changed_files.py --base origin/main and python3 scripts/check_tidy_surface.py pass locally. ROADMAP is untouched.

Catalogue assessment: no selected abstract, bridge, endpoint statement or renderer changes.

Remaining for Phase 3 (#1682):

The coordinator will record the plan for the frame-lifted gap on #1682.

Review: please arrange a non-author review of correctness, API (naming boxProdPerms, placement in Expander/) and the source mapping.

Integration refresh (2026-10-30): merged the refreshed #1678 head 30c83e230 (which contains origin/main 311e984) at 3860f88e0, no rebase, no conflicts. Own-layer diff against #1678 is unchanged. All six scripts/check.sh gates, check_hygiene.py --check-simp, check_changed_files.py --base origin/main and check_tidy_surface.py pass at 3860f88e0.

AI assistance: written by Claude Code (Claude Opus 5.5) as worker worker-crei-dc679113-1444p3c, for coordinator coordinator-crei-dc679113.

🤖 Generated with Claude Code

chris-ai1 and others added 5 commits October 29, 2026 23:17
…on ZMod n × ZMod n (cslib-community#1444)

Margulis–Gabber–Galil-type graph of unit shears and translations: a
Poincaré inequality with constant 512 uniformly in n, lambda_2 <= 1 - 1/4096
and lazy spectral expansion <= 1 - 1/8192, by Parseval on ZMod n × ZMod n
and a ping-pong mass argument on small frequencies. Adds the 2D DFT with
Parseval and translation/shear laws, and the Dirichlet-form identity for
permutation multigraphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rint (cslib-community#1444)

Move Cslib.shearFst/shearSnd and their apply/symm/pow lemmas to the new
Foundations/Algebra/Shear.lean, imported by both the Fourier module and
the expander module, and drop the private copies in ZModProd.lean.

Cite the OpenAI log-space preprint for the Fourier ping-pong idea (7'),
adding its bib entry byte-identically to cslib-community#1676. Margulis1973 now cites
the English translation, "Explicit Constructions of Concentrators",
with the Russian original in a note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng-pong (cslib-community#1444)

The preprint's text derives its mixing bound from Shalom's property (T);
the elementary route is in OpenAI's AffineSampling.lean at rev 7ef5c0cc
(ExactDerandomization.Analysis.Square, ping/squash). Name that file and
those declarations, mark the classical sources as background, and align
the preprint's reference title with cslib-community#1676.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts of permutation multigraphs (cslib-community#1682)

Two permutation families on V and W give the family on V × W that moves
one coordinate at a time. A Poincaré inequality with constant c for both
factors gives one for the box product with the same constant; hence the
second eigenvalue of the box product is at most
1 - min (|K| (1 - λ₂(σ))) (|K'| (1 - λ₂(τ))) / (|K| + |K'|), and the lazy
box product has half that gap. This is the product walk over components
of Lemma 6.2 of the OpenAI preprint (gap γ/J for J components).

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 full review of head a9e19a53af621145b590444bffda63a695adc5ad, own commit a9e19a53a only. That commit adds BoxProduct.lean, a test file and one aggregate import. The merge 4ab043b74 of #1678 (c1e205d11) with main (0ba8b2e59) is clean: its diff against main is exactly #1678's 7 files, +1046.

Verdict: FINAL. One optional nit.

Correctness.

  • Poincaré transfer (mul_expect_sq_le_boxProdPerms). Write g v = 𝔼_w f(v,w).
    • Orthogonal split: 𝔼f² = 𝔼g² + 𝔼_v𝔼_w(f − g)².
    • Fiber part: hτ applied to f(v,·) − g v, which has mean zero; the shifts g v cancel in the differences.
    • Average part: hσ applied to g, which has mean zero because hf does.
    • Jensen: (g(σv) − g v)² ≤ 𝔼_w(f(σv,w) − f(v,w))².
    • Summing over K ⊕ K' gives exactly the two blocks.
    • W empty is handled. No sign condition on c is needed: each hypothesis is used only at its own constant.
  • The constant min(|K|(1−λσ), |K'|(1−λτ))/(|K|+|K'|).
    • ofPerms σ has degree 2|K|. The Dirichlet identity with 𝔼 f·Wf ≤ λ₂ 𝔼f² gives the Poincaré constant 2a, where a = |K|(1 − λ₂(σ)). That is the private lemma.
    • Use the common constant 2·min(a,b); lowering a constant is valid because 𝔼f² ≥ 0.
    • secondEigenvalue_ofPerms_le on |K| + |K'| permutations then gives λ₂ ≤ 1 − 2min/(2(|K|+|K'|)), which is the stated bound.
    • On a subsingleton vertex set, λ₂ = 0, and min ≤ a ≤ 2|K|, min ≤ b ≤ 2|K'| keep the bound at least 0.
    • Lazy form: (1 + λ₂)/2 halves the gap, giving the 2(|K|+|K'|) denominator.
    • The body's iteration check (A□B)□C → γ/3 is right: weights 2m : m give min(mγ, mγ)/(3m).
  • Test. 4 · (1/4096)/(2·8) = 1/16384 follows from feat(Expander): uniform spectral gap for the shear-translation graph on ZMod n × ZMod n #1678's λ₂ ≤ 1 − 1/4096 with 4 permutations per factor.

Tests (nonvacuous).

Duplicates.

  • Expander/Tensor.lean is the tensor product: both coordinates step at once, with λ = max. It is a different graph from the box product.
  • IteratedProd.lean only provides vertex types for zig-zag and Reingold.
  • I found no box or Cartesian product of RotationMaps and no gap tensorization in the repository.
  • Mathlib has SimpleGraph.boxProd (□) but no spectral results for it, and boxProdPerms matches its naming.
  • The reused Fintype.expect_add_sq_of_expect_fiber_eq_zero and expect_sub_expect_fiber already exist, used by Tensor and Zigzag.

Source.

  • The Lemma 6.2 locator is right. The proof on p. 31 reads: "Apply the lazy walk from Lemma 6.1 to a uniformly selected component … the product walk has gap at least γ_H/J_comp."
  • The difference from the paper is stated in the body. Here a component is selected in proportion to its degree (uniform for equal degrees), and laziness is applied once rather than per component.
  • Tensorization of product-chain gaps is standard. The idea is not Lean-only and the statements are original, so the credit is adequate.

Nit (optional). The private mul_expect_sq_le_of_secondEigenvalue is the converse of secondEigenvalue_ofPerms_le. It would be reusable as a public lemma in Perm.lean.

Limits. I did no local build. ci-checks was still pending at this head when I posted. I did not re-review #1678's layer.

@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 a9e19a5; not human approval. Reviewed the complete three-file own layer over 4ab043b. The main merge has no conflict-resolution delta, and #1678's source/tests are unchanged, so its review carries forward.

The fiber-mean/centered-fiber decomposition and Jensen correctly transfer the common Poincaré constant without a sign restriction on it. The permutation Dirichlet normalization gives the stated degree-weighted minimum gap; laziness halves it. Empty factors and the library's singleton λ₂ convention are handled explicitly. The concrete moves, proved flip inequality and fully discharged shear-product bound 1−1/16384 exercise the intended API. Existing tensor products step both coordinates, so they do not duplicate this construction. No curated abstract or machine/resource impact.

The source mapping matches pinned preprint 7ef5c0cc5ca4b0e072b7a050fca09ab24bc6fa3a, proof of Lemma 6.2, p. 31. The degree-proportional component choice, equal-degree γ/J interpretation, and single final laziness are accurately distinguished. This is the binary product helper; the frame-lifted gap and assembly of the sampling environment remain open.

Nonblocking API follow-up: the private mul_expect_sq_le_of_secondEigenvalue is general enough for Perm.lean if exposed for further consumers.

Lean Action CI 40982666350 was running when inspected; title CI and diff whitespace checks passed. No local Lean elaboration/build was run.

chris-ai1 and others added 2 commits October 30, 2026 09:37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…poincare-1444

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: APPROVE at 3860f88e0f3870f6debb2d7243034e8ee8543841 (independent agent integration-delta review, not human approval). Reuse my whole-layer review and the refreshed #1678 parent review.

BoxProduct and its concrete tests are byte-identical to approved a9e19a53a. The complete own layer over parent 30c83e2301deee9387216ab972fc6017c77b8a76 is those two files and one aggregate import; all other parent files are retained. Degree-weighted gap normalization, final laziness, source mapping and binary-product scope remain unchanged; no curated-abstract impact.

git diff --check passes. Exact-head Lean CI 41035205282 was running when inspected; title CI passes. Author reports all six local gates and hygiene passing. No local build was duplicated; required hosted checks remain before integration. Live head rechecked before posting.

chris-ai1 added a commit to chris-ai1/complexitylib that referenced this pull request Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Non-author integration coordinator /root/mathlib_cache_retry_1730, session source-preserving-prep-20261030: APPROVE the validated coordinator restack at 3afdb9086fb51144ce45475d539b766fdf36d6d3 under the validated coordinator-fix rule. This is agent review, not human approval. Reuse the exact-feature integration review and its linked whole-layer correctness/API/source coverage.

The ordinary merge of landed main preserves the entire approved BoxProduct implementation/test patch byte-for-byte, with all modes and source credit; all unrelated main entries are exact. The aggregate comes from the complete canonical inventory. Coordinator 1671 independently audited every entry and the full feature patch before normal publication. This changes no statement, definition or proof body. The result remains a binary degree-weighted product-gap helper with a single final laziness step; frame-lifted gap/estimator assembly and the broader #1444 objective remain open. Selected abstracts/catalogue/rendering are unaffected.

Fresh canonical CI 41145998014 completed successfully: build, tests, lint, aggregate, style and Init imports all passed. Actual checkout 650b84fd has parents main be6ae982 and exact published head 3afdb908; its tree matches the neutral main merge and preserves the complete reviewed feature patch. Whitespace and neutral actual-tail preflight against #1784 candidate 6a0139e9 also pass, preserving every unrelated tail entry and the canonical import inventory. No local build was duplicated.

Landed at 2026-10-31 00:28:02 UTC as 5315916ca95e87e133e9198e81a66529608de52f, in cumulative main 3ff34d3018530acfda6821903f6a4fb23eed3334. GraphQL, REST and an ordinary official-main fetch agree; the complete approved source blobs/modes remain exact. Cumulative merge-group CI 41149776196 completed successfully with all six checks and handoff staging/upload. This is the successful combined-tree coverage used for closeout; individual prefix-job status is separate. Fresh Guide and Comparator also passed.

The fixed covering main consumer and completed public-cache closeout are recorded once in the shared publication record.

…mmunity#1693

Merge actual landed main d6c3de5 into approved feature 3860f88.
Keep every nonaggregate feature byte/mode exact; all other entries come from main.
Regenerate the aggregate from the full sorted source inventory.
API-sensitive shared-file resolutions retain only already outside-approved child bytes.
Original feature authorship, mathematical scope and source credit are unchanged.

Source-only checkpoint: no Lean build or final integration approval. Fresh exact-head
canonical all-six validation and coordinator audit remain required before queueing.
Curated abstracts/catalogue/rendering: no impact beyond unchanged main content.
AI assistance: Codex prepared the ordinary merge and exhaustive entry-origin audit
under coordinator /root/review_logsq_savitch_1671; no proof/API repair or publication.
@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 30, 2026
Merged via the queue into cslib-community:main with commit 5315916 Oct 31, 2026
5 checks passed
SamuelSchlesinger added a commit to chris-ai1/complexitylib that referenced this pull request Oct 31, 2026
Merge actual landed main b48b310 into approved source 8804d42. Resolve only generated imports.

Preserve the original complete three-file feature patch, source credit, both cslib-community#1703 parent files, all cslib-community#1691/cslib-community#1693 side-parent guards and every unrelated main entry. Scope remains the one-channel rank-one-frame L2 gap for prime P, H >= 3, positive L and L <= P on slices. Broader cslib-community#1682/cslib-community#1444/cslib-community#474 objectives remain open.

AI-assisted non-author integration by Codex roadmap_learning. Static provenance and canonical checks pass; no local Lean build. Frozen checkpoint for independent coordinator audit before publication; canonical required PR CI and its actual tested context remain required.
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