Vernier CRT seam-density theorem (sorry-free)#17
Vernier CRT seam-density theorem (sorry-free)#17Todd Baur (toadkicker) wants to merge 3 commits into
Conversation
Transcribes the within-axis vernier seam-density theorem (pairwise-coprime grid periods => positions near a seam on every grid number exactly prod min(2t+1,m_i)) into Lean, building toward the OrdvecFormalization corpus. Placed in drafts/, NOT in OrdvecFormalization/, because it still contains 4 `sorry` proof-debt items (crux: the indexed CRT bijection crtEquiv). The audit target scans only the OrdvecFormalization tree, so the sorry-free invariant and green CI are preserved. drafts/README.md documents the proof debt and the promotion checklist. Provenance: exhaustively verified by finite enumeration over Z/M and proved on paper in the companion research branch; this is the Lean transcription awaiting Mathlib bookkeeping. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Todd Baur <todd@baursoftware.com>
There was a problem hiding this comment.
Code Review
This pull request adds a proof sketch for the within-axis vernier CRT seam-density theorem in drafts/VernierSeamDensity.lean, along with a descriptive drafts/README.md. The review feedback correctly identifies that Lean's typeclass resolution cannot automatically synthesize NeZero (∏ i, m i) from [∀ i, NeZero (m i)]. To prevent elaboration failures and ensure Finset.univ can resolve its Fintype instance, you should explicitly add [NeZero (∏ i, m i)] as an instance argument to crtEquiv, blindspot_card_positions, and unique_coincidence_per_period.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Gemini PR review (correct): typeclass resolution cannot synthesize NeZero (∏ i, m i) from [∀ i, NeZero (m i)] — ∏ is a general Finset.prod (the derivation goes via Finset.prod_ne_zero_iff, not an instance). Without it ZMod (∏ i, m i) has no Fintype instance and Finset.univ fails to elaborate. Added [NeZero (∏ i, m i)] to crtEquiv, blindspot_card_positions, and unique_coincidence_per_period. These are STATEMENT-correctness fixes so the theorem has the right shape; the 3 sorry proof-debt items are unchanged and intentional (see header) — this draft is a transcription awaiting a Lean toolchain to discharge crtEquiv et al. against a live compiler. Fixed a stale "4 items" -> "3 sorry items" count. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Todd Baur <todd@baursoftware.com>
Discharged all proof debt against Lean 4.28 + Mathlib. The 3 sorries are gone: - crtEquiv: built from Mathlib's ZMod.prodEquivPi (indexed CRT ring iso) — the Pi-CRT already exists, no bespoke induction needed. - card_admissible: card_image_of_injOn + ZMod natCast window injectivity. - blindspot_card_positions: transported across crtEquiv via Finset.card_equiv. Verification (all green): - lake build: module compiles - #print axioms: blindspot_card_positions / card_admissible / crtEquiv depend only on [propext, Classical.choice, Quot.sound] — NO sorryAx - make audit: no sorry in tree - make verify: theorem dashboard builds - lake lint: passed - check-doc-names: 277 names verified (added the 5 new public names to docs/theorem-map.md) Moved OrdvecFormalization/VernierSeamDensity.lean into the audited tree, registered in the root aggregator, removed the drafts/ sketch. This is now a real verified contribution to the formalization corpus. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Todd Baur <todd@baursoftware.com>
|
Promoted from draft → verified, sorry-free. All proof debt discharged against Lean 4.28 + Mathlib on a local toolchain. The crux turned out NOT to need a bespoke Moved into the audited
Theorem: for pairwise-coprime grid periods |
Code Review by Qodo
1. Long-line linter violation
|
PR Summary by QodoFormalize vernier CRT seam-density theorem in OrdvecFormalization WalkthroughsDescription• Add Lean formalization of within-axis vernier seam-density counting over coprime grids. • Register the new theorem module in the OrdvecFormalization root import aggregator. • Extend theorem-map documentation to list the new vernier seam-density results. Diagramgraph TD
agg["OrdvecFormalization.lean"] --> vernier["VernierSeamDensity.lean"] --> mathlib["Mathlib (ZMod/Finset)"]
docs["docs/theorem-map.md"] --> vernier
High-Level AssessmentThe following are alternative approaches to this PR: 1. Expose `crtEquiv` as a `RingEquiv` (or use `ZMod.prodEquivPi` directly in statements)
2. Factor the position-space count via `Fintype.card_congr` on subtype sets
Recommendation: Current approach is solid: prove a per-modulus File ChangesEnhancement (2)
Documentation (1)
|
|
CI note: the Lean workflow shows For reference, the full gate sequence was run locally against Lean 4.28.0 + the pinned Mathlib and all passed:
So I expect the upstream run to go green once approved. |
Verified, sorry-free. Adds the within-axis vernier CRT seam-density
theorem to the
OrdvecFormalizationcorpus. All proofs discharged againstLean 4.28.0 + the pinned Mathlib.
Theorem
For pairwise-coprime grid periods
m : Fin L → ℕ, the positions inZMod (∏ m i)within bandtof a seam on every grid number exactly∏ (2t+1)(capped form∏ min(2t+1, m i)once a band saturates its grid).In particular (
t = 0) there is exactly one all-grids coincidence per period.Proof structure
crtEquiv— the indexed CRT bijectionZMod (∏ m i) ≃ Π i, ZMod (m i), takenas
.toEquivof Mathlib's existingZMod.prodEquivPi(no bespokeFin Lfold of the two-modulus CRT was needed — the Pi-CRT is already in Mathlib).
Carries
[∀ i, NeZero (m i)]and[NeZero (∏ i, m i)](the latter is notsynthesizable from the former —
∏is a generalFinset.prod). Sole consumerof coprimality.
card_admissible—Finset.card_image_of_injOn+ZModnatCast windowinjectivity (
2t+1 ≤ m⇒ no wraparound).blindspot_card_product—Fintype.card_piFinset. The easy half; carriesno coprimality hypothesis, which is the honest statement of what it proves.
blindspot_card_positions— the real theorem; transports the product countacross
crtEquivviaFinset.card_equiv.unique_coincidence_per_period— thet = 0corollary.Verification (all green locally)
lake build✔#print axiomson all 5 public names →[propext, Classical.choice, Quot.sound],no
sorryAxmake audit✔ (no sorry in tree) ·make verify✔ ·lake lint✔(
Linting passed) ·check-doc-names✔ (277 names)Files
OrdvecFormalization/VernierSeamDensity.lean(new, in the audited tree)OrdvecFormalization.lean— registered in the root aggregatordocs/theorem-map.md— 5 new public namesProvenance
Cross-checked exhaustively by finite enumeration over
ℤ/Min the companionordvec research repo's Rust oracle; this is the verified Lean proof.
CI note
The upstream Lean workflow currently shows
action_required— this is a forkPR, so GitHub holds the run pending a maintainer "Approve and run workflows"
click (first-time fork-contributor gate). It has not failed; it has not been
allowed to start. Approving the run populates the required
buildcheck andclears
BLOCKED. Given the local results above, I expect it green.🤖 Generated with Claude Code